otomato-sdk 2.0.538 → 2.0.541

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4013,8 +4013,12 @@ export const TRIGGERS = {
4013
4013
  "FLUID": {
4014
4014
  "description": "A leading DeFi protocol enabling secure borrowing, lending, and yield generation across multiple assets.",
4015
4015
  "chains": [
4016
+ 1,
4016
4017
  8453,
4017
- 1
4018
+ 42161,
4019
+ 137,
4020
+ 56,
4021
+ null
4018
4022
  ],
4019
4023
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fluid.webp",
4020
4024
  "LENDING_RATE": {
@@ -4022,11 +4026,7 @@ export const TRIGGERS = {
4022
4026
  "dynamicName": "async (env, { otomatoSDK }) => {\n const { getDynamicNameWrapperHTML, getTokenHTML, getChainHTML, getComparisonString } = otomatoSDK;\n return getDynamicNameWrapperHTML(\n `Lending rate for`,\n await getTokenHTML(env.parameters.chainId, env.parameters.asset),\n `on ${getChainHTML(env.parameters.chainId)} ${getComparisonString(env.parameters.condition, env.parameters.comparisonValue)}`\n );\n }",
4023
4027
  "description": "Get the lending rate of any asset on Fluid",
4024
4028
  "prototype": "fluidLendingRate",
4025
- "type": 3,
4026
- "method": "GET",
4027
- "output": {
4028
- "lendingRate": "float"
4029
- },
4029
+ "type": 6,
4030
4030
  "parameters": [
4031
4031
  {
4032
4032
  "key": "chainId",
@@ -4038,9 +4038,8 @@ export const TRIGGERS = {
4038
4038
  {
4039
4039
  "key": "asset",
4040
4040
  "type": "erc20",
4041
- "description": "The token you want to fetch the lending rate",
4041
+ "description": "The token you want to fetch the lending rate for",
4042
4042
  "mandatory": true,
4043
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n const availableLendingTokens = {\n \"1\": [\n \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"0xdac17f958d2ee523a2206206994597c13d831ec7\",\n \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n \"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0\"\n ],\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x4200000000000000000000000000000000000006\"\n ]\n};\n return availableLendingTokens[env.parameters.chainId] || [];\n }",
4044
4043
  "category": 0
4045
4044
  },
4046
4045
  {
@@ -4058,11 +4057,15 @@ export const TRIGGERS = {
4058
4057
  "category": 0
4059
4058
  },
4060
4059
  ],
4060
+ "output": {
4061
+ "lendingRate": "float",
4062
+ "comparisonValue": "float"
4063
+ },
4061
4064
  "examples": [
4062
4065
  {
4063
- "name": "USDC Lending Rate is above 5%",
4064
- "description": "USDC Lending Rate is above 5% on Mainnet",
4065
- "externalVariableDescription": "Fetches the current WETH lending rate on Ethereum",
4066
+ "name": "USDC Lending Rate is above 5% on Ethereum",
4067
+ "description": "Fetches the current USDC lending rate on Fluid Ethereum",
4068
+ "externalVariableDescription": "Fetches the current USDC lending rate on Fluid",
4066
4069
  "parameters": [
4067
4070
  {
4068
4071
  "key": "chainId",
@@ -4070,7 +4073,30 @@ export const TRIGGERS = {
4070
4073
  },
4071
4074
  {
4072
4075
  "key": "asset",
4073
- "value": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
4076
+ "value": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
4077
+ },
4078
+ {
4079
+ "key": "condition",
4080
+ "value": "gt"
4081
+ },
4082
+ {
4083
+ "key": "comparisonValue",
4084
+ "value": 5
4085
+ }
4086
+ ]
4087
+ },
4088
+ {
4089
+ "name": "USDC Lending Rate is above 5% on Base",
4090
+ "description": "Fetches the current USDC lending rate on Fluid Base",
4091
+ "externalVariableDescription": "Fetches the current USDC lending rate on Fluid Base",
4092
+ "parameters": [
4093
+ {
4094
+ "key": "chainId",
4095
+ "value": 8453
4096
+ },
4097
+ {
4098
+ "key": "asset",
4099
+ "value": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
4074
4100
  },
4075
4101
  {
4076
4102
  "key": "condition",
@@ -4085,6 +4111,210 @@ export const TRIGGERS = {
4085
4111
  ],
4086
4112
  "blockId": 37,
4087
4113
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fluid.webp"
4114
+ },
4115
+ "BORROWING_RATE": {
4116
+ "name": "Borrowing rate",
4117
+ "dynamicName": "async (env, { otomatoSDK }) => {\n const { getChainHTML, getComparisonString } = otomatoSDK;\n return `<div>Borrowing rate for Fluid position <b>#${env.parameters.nftId}</b> on ${getChainHTML(env.parameters.chainId)} ${getComparisonString(env.parameters.condition, env.parameters.comparisonValue)}</div>`;\n }",
4118
+ "description": "Get the borrowing rate of the vault that holds a given Fluid NFT position",
4119
+ "prototype": "fluidBorrowingRate",
4120
+ "type": 6,
4121
+ "parameters": [
4122
+ {
4123
+ "key": "chainId",
4124
+ "type": "chainId",
4125
+ "description": "Chain ID of the network",
4126
+ "mandatory": true,
4127
+ "category": 0
4128
+ },
4129
+ {
4130
+ "key": "nftId",
4131
+ "type": "integer",
4132
+ "description": "The Fluid position NFT id (the block resolves the vault address via vaultByNftId)",
4133
+ "mandatory": true,
4134
+ "category": 0
4135
+ },
4136
+ {
4137
+ "key": "condition",
4138
+ "type": "logic_operator",
4139
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
4140
+ "mandatory": true,
4141
+ "category": 0
4142
+ },
4143
+ {
4144
+ "key": "comparisonValue",
4145
+ "type": "float",
4146
+ "description": "The value to compare to",
4147
+ "mandatory": true,
4148
+ "category": 0
4149
+ },
4150
+ ],
4151
+ "output": {
4152
+ "borrowingRate": "float",
4153
+ "comparisonValue": "float"
4154
+ },
4155
+ "examples": [
4156
+ {
4157
+ "name": "Fluid position #2569 borrowing rate above 3%",
4158
+ "description": "Monitor the borrowing rate of the vault holding Fluid position #2569 (ETH→USDC v11) on Ethereum",
4159
+ "externalVariableDescription": "Fluid borrowing rate by nftId",
4160
+ "parameters": [
4161
+ {
4162
+ "key": "chainId",
4163
+ "value": 1
4164
+ },
4165
+ {
4166
+ "key": "nftId",
4167
+ "value": 2569
4168
+ },
4169
+ {
4170
+ "key": "condition",
4171
+ "value": "gt"
4172
+ },
4173
+ {
4174
+ "key": "comparisonValue",
4175
+ "value": 3
4176
+ }
4177
+ ]
4178
+ }
4179
+ ],
4180
+ "blockId": 150,
4181
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fluid.webp"
4182
+ },
4183
+ "HEALTH_FACTOR": {
4184
+ "name": "Health Factor",
4185
+ "dynamicName": "async (env, { otomatoSDK }) => {\n const { getChainHTML, getComparisonString } = otomatoSDK;\n return `<div>Fluid position <b>#${env.parameters.nftId}</b> health factor on ${getChainHTML(env.parameters.chainId)} ${getComparisonString(env.parameters.condition, env.parameters.comparisonValue)}</div>`;\n }",
4186
+ "description": "Get the health factor for an individual Fluid vault position by NFT id",
4187
+ "prototype": "fluidHealthFactor",
4188
+ "type": 6,
4189
+ "parameters": [
4190
+ {
4191
+ "key": "chainId",
4192
+ "type": "chainId",
4193
+ "description": "Chain ID of the network",
4194
+ "mandatory": true,
4195
+ "category": 0
4196
+ },
4197
+ {
4198
+ "key": "nftId",
4199
+ "type": "integer",
4200
+ "description": "The Fluid position NFT id to monitor (each Fluid position is an NFT with its own isolated health factor)",
4201
+ "mandatory": true,
4202
+ "category": 0
4203
+ },
4204
+ {
4205
+ "key": "condition",
4206
+ "type": "logic_operator",
4207
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
4208
+ "mandatory": true,
4209
+ "category": 0
4210
+ },
4211
+ {
4212
+ "key": "comparisonValue",
4213
+ "type": "float",
4214
+ "description": "The value to compare to",
4215
+ "mandatory": true,
4216
+ "category": 0
4217
+ },
4218
+ ],
4219
+ "output": {
4220
+ "healthFactor": "float",
4221
+ "comparisonValue": "float"
4222
+ },
4223
+ "examples": [
4224
+ {
4225
+ "name": "Fluid Position #2569 Health Factor below 2 on Ethereum",
4226
+ "description": "Alert when Fluid position NFT #2569 (an ETH/USDC borrow position) health factor drops below 2",
4227
+ "externalVariableDescription": "Fluid position health factor",
4228
+ "parameters": [
4229
+ {
4230
+ "key": "chainId",
4231
+ "value": 1
4232
+ },
4233
+ {
4234
+ "key": "nftId",
4235
+ "value": 2569
4236
+ },
4237
+ {
4238
+ "key": "condition",
4239
+ "value": "lte"
4240
+ },
4241
+ {
4242
+ "key": "comparisonValue",
4243
+ "value": 2
4244
+ }
4245
+ ]
4246
+ }
4247
+ ],
4248
+ "blockId": 149,
4249
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fluid.webp"
4250
+ },
4251
+ "VAULT_SUPPLY_RATE": {
4252
+ "name": "Vault supply rate",
4253
+ "dynamicName": "async (env, { otomatoSDK }) => {\n const { getChainHTML, getComparisonString } = otomatoSDK;\n return `<div>Supply rate for Fluid position <b>#${env.parameters.nftId}</b> on ${getChainHTML(env.parameters.chainId)} ${getComparisonString(env.parameters.condition, env.parameters.comparisonValue)}</div>`;\n }",
4254
+ "description": "Get the collateral supply rate of the vault that holds a given Fluid NFT position. For plain collateral this matches the fToken lending rate; for smart collateral (DEX pairs) it includes DEX trading fees and underlying yields.",
4255
+ "prototype": "fluidVaultSupplyRate",
4256
+ "type": 6,
4257
+ "parameters": [
4258
+ {
4259
+ "key": "chainId",
4260
+ "type": "chainId",
4261
+ "description": "Chain ID of the network",
4262
+ "mandatory": true,
4263
+ "category": 0
4264
+ },
4265
+ {
4266
+ "key": "nftId",
4267
+ "type": "integer",
4268
+ "description": "The Fluid position NFT id (the block resolves the vault address via vaultByNftId)",
4269
+ "mandatory": true,
4270
+ "category": 0
4271
+ },
4272
+ {
4273
+ "key": "condition",
4274
+ "type": "logic_operator",
4275
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
4276
+ "mandatory": true,
4277
+ "category": 0
4278
+ },
4279
+ {
4280
+ "key": "comparisonValue",
4281
+ "type": "float",
4282
+ "description": "The value to compare to",
4283
+ "mandatory": true,
4284
+ "category": 0
4285
+ },
4286
+ ],
4287
+ "output": {
4288
+ "supplyRate": "float",
4289
+ "comparisonValue": "float"
4290
+ },
4291
+ "examples": [
4292
+ {
4293
+ "name": "Fluid position #2569 supply rate below 1%",
4294
+ "description": "Alert when the collateral supply rate for Fluid position #2569 drops below 1%",
4295
+ "externalVariableDescription": "Fluid vault supply rate by nftId",
4296
+ "parameters": [
4297
+ {
4298
+ "key": "chainId",
4299
+ "value": 1
4300
+ },
4301
+ {
4302
+ "key": "nftId",
4303
+ "value": 2569
4304
+ },
4305
+ {
4306
+ "key": "condition",
4307
+ "value": "lt"
4308
+ },
4309
+ {
4310
+ "key": "comparisonValue",
4311
+ "value": 1
4312
+ }
4313
+ ]
4314
+ }
4315
+ ],
4316
+ "blockId": 151,
4317
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fluid.webp"
4088
4318
  }
4089
4319
  },
4090
4320
  "MORPHO": {
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '2.0.538';
1
+ export const SDK_VERSION = '2.0.541';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -1564,7 +1564,7 @@ export declare const TRIGGERS: {
1564
1564
  };
1565
1565
  FLUID: {
1566
1566
  description: string;
1567
- chains: number[];
1567
+ chains: (number | null)[];
1568
1568
  image: string;
1569
1569
  LENDING_RATE: {
1570
1570
  name: string;
@@ -1572,11 +1572,89 @@ export declare const TRIGGERS: {
1572
1572
  description: string;
1573
1573
  prototype: string;
1574
1574
  type: number;
1575
- method: string;
1575
+ parameters: Parameter[];
1576
1576
  output: {
1577
1577
  lendingRate: string;
1578
+ comparisonValue: string;
1579
+ };
1580
+ examples: {
1581
+ name: string;
1582
+ description: string;
1583
+ externalVariableDescription: string;
1584
+ parameters: ({
1585
+ key: string;
1586
+ value: number;
1587
+ } | {
1588
+ key: string;
1589
+ value: string;
1590
+ })[];
1591
+ }[];
1592
+ blockId: number;
1593
+ image: string;
1594
+ };
1595
+ BORROWING_RATE: {
1596
+ name: string;
1597
+ dynamicName: string;
1598
+ description: string;
1599
+ prototype: string;
1600
+ type: number;
1601
+ parameters: Parameter[];
1602
+ output: {
1603
+ borrowingRate: string;
1604
+ comparisonValue: string;
1605
+ };
1606
+ examples: {
1607
+ name: string;
1608
+ description: string;
1609
+ externalVariableDescription: string;
1610
+ parameters: ({
1611
+ key: string;
1612
+ value: number;
1613
+ } | {
1614
+ key: string;
1615
+ value: string;
1616
+ })[];
1617
+ }[];
1618
+ blockId: number;
1619
+ image: string;
1620
+ };
1621
+ HEALTH_FACTOR: {
1622
+ name: string;
1623
+ dynamicName: string;
1624
+ description: string;
1625
+ prototype: string;
1626
+ type: number;
1627
+ parameters: Parameter[];
1628
+ output: {
1629
+ healthFactor: string;
1630
+ comparisonValue: string;
1578
1631
  };
1632
+ examples: {
1633
+ name: string;
1634
+ description: string;
1635
+ externalVariableDescription: string;
1636
+ parameters: ({
1637
+ key: string;
1638
+ value: number;
1639
+ } | {
1640
+ key: string;
1641
+ value: string;
1642
+ })[];
1643
+ }[];
1644
+ blockId: number;
1645
+ image: string;
1646
+ };
1647
+ VAULT_SUPPLY_RATE: {
1648
+ name: string;
1649
+ dynamicName: string;
1650
+ description: string;
1651
+ prototype: string;
1652
+ type: number;
1579
1653
  parameters: Parameter[];
1654
+ output: {
1655
+ supplyRate: string;
1656
+ comparisonValue: string;
1657
+ };
1580
1658
  examples: {
1581
1659
  name: string;
1582
1660
  description: string;
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.538";
1
+ export declare const SDK_VERSION = "2.0.541";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "2.0.538",
3
+ "version": "2.0.541",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "repository": {
6
6
  "type": "git",