@defisaver/positions-sdk 0.0.201-fluid-dev-6 → 0.0.201-fluid-dev-8

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.
Files changed (83) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/fluid/index.d.ts +4 -0
  5. package/cjs/fluid/index.js +12 -1
  6. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  7. package/cjs/markets/fluid/index.js +8 -0
  8. package/cjs/types/fluid.d.ts +1 -0
  9. package/esm/fluid/index.d.ts +4 -0
  10. package/esm/fluid/index.js +10 -0
  11. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  12. package/esm/markets/fluid/index.js +8 -0
  13. package/esm/types/fluid.d.ts +1 -0
  14. package/package.json +51 -51
  15. package/src/aaveV2/index.ts +227 -227
  16. package/src/aaveV3/index.ts +625 -625
  17. package/src/assets/index.ts +60 -60
  18. package/src/chickenBonds/index.ts +123 -123
  19. package/src/compoundV2/index.ts +220 -220
  20. package/src/compoundV3/index.ts +291 -291
  21. package/src/config/contracts.js +1122 -1122
  22. package/src/constants/index.ts +6 -6
  23. package/src/contracts.ts +134 -134
  24. package/src/curveUsd/index.ts +229 -229
  25. package/src/eulerV2/index.ts +303 -303
  26. package/src/exchange/index.ts +17 -17
  27. package/src/fluid/index.ts +343 -328
  28. package/src/helpers/aaveHelpers/index.ts +198 -198
  29. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  30. package/src/helpers/compoundHelpers/index.ts +246 -246
  31. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  32. package/src/helpers/eulerHelpers/index.ts +232 -232
  33. package/src/helpers/fluidHelpers/index.ts +53 -53
  34. package/src/helpers/index.ts +11 -11
  35. package/src/helpers/liquityV2Helpers/index.ts +79 -79
  36. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  37. package/src/helpers/makerHelpers/index.ts +94 -94
  38. package/src/helpers/morphoBlueHelpers/index.ts +365 -365
  39. package/src/helpers/sparkHelpers/index.ts +150 -150
  40. package/src/index.ts +52 -52
  41. package/src/liquity/index.ts +116 -116
  42. package/src/liquityV2/index.ts +227 -227
  43. package/src/llamaLend/index.ts +275 -275
  44. package/src/maker/index.ts +117 -117
  45. package/src/markets/aave/index.ts +152 -152
  46. package/src/markets/aave/marketAssets.ts +44 -44
  47. package/src/markets/compound/index.ts +213 -213
  48. package/src/markets/compound/marketsAssets.ts +82 -82
  49. package/src/markets/curveUsd/index.ts +69 -69
  50. package/src/markets/euler/index.ts +26 -26
  51. package/src/markets/fluid/index.ts +2010 -2002
  52. package/src/markets/index.ts +27 -27
  53. package/src/markets/liquityV2/index.ts +43 -43
  54. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  55. package/src/markets/llamaLend/index.ts +235 -235
  56. package/src/markets/morphoBlue/index.ts +895 -895
  57. package/src/markets/spark/index.ts +29 -29
  58. package/src/markets/spark/marketAssets.ts +10 -10
  59. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  60. package/src/morphoAaveV2/index.ts +256 -256
  61. package/src/morphoAaveV3/index.ts +631 -631
  62. package/src/morphoBlue/index.ts +202 -202
  63. package/src/multicall/index.ts +33 -33
  64. package/src/services/dsrService.ts +15 -15
  65. package/src/services/priceService.ts +91 -91
  66. package/src/services/utils.ts +59 -59
  67. package/src/setup.ts +8 -8
  68. package/src/spark/index.ts +461 -461
  69. package/src/staking/staking.ts +220 -220
  70. package/src/types/aave.ts +271 -271
  71. package/src/types/chickenBonds.ts +45 -45
  72. package/src/types/common.ts +84 -84
  73. package/src/types/compound.ts +131 -131
  74. package/src/types/curveUsd.ts +118 -118
  75. package/src/types/euler.ts +171 -171
  76. package/src/types/fluid.ts +264 -263
  77. package/src/types/index.ts +11 -11
  78. package/src/types/liquity.ts +30 -30
  79. package/src/types/liquityV2.ts +118 -118
  80. package/src/types/llamaLend.ts +155 -155
  81. package/src/types/maker.ts +50 -50
  82. package/src/types/morphoBlue.ts +192 -192
  83. package/src/types/spark.ts +131 -131
package/.mocharc.json CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "require": "ts-node/register",
3
- "extension": ["ts"]
4
- }
1
+ {
2
+ "require": "ts-node/register",
3
+ "extension": ["ts"]
4
+ }
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- v20.17.0
1
+ v20.17.0
package/README.md CHANGED
@@ -1,69 +1,69 @@
1
- # DeFi Saver Positions SDK
2
-
3
- Supported protocols:
4
- - [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
5
- - [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
6
- - [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
7
- - [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
8
- - [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
9
- - [Morpho Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV2)
10
- - [Morpho Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV3)
11
- - [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
12
- - [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
13
- - [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
14
- - [Chicken Bonds](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/chickenBonds)
15
-
16
- ## Setup
17
- Supported Node version is v10.
18
-
19
- - run `npm install` (first time)
20
- - run `npm run build`
21
-
22
- `build` command will generate contracts and build ejs and esm folders
23
-
24
- ## How to use
25
- [All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
26
-
27
- This is a Compound V3 example, and every other protocol is similar
28
- ```js
29
- import Web3 from 'web3';
30
- import { compoundV3 } from '@defisaver/positions-sdk';
31
-
32
-
33
- // every protocol has market data and user data getters
34
- const {
35
- getCompoundV3MarketsData,
36
- getCompoundV3AccountData,
37
- } = compoundV3;
38
-
39
- const provider = 'Your RPC provider';
40
- const web3 = new Web3(provider);
41
-
42
- const user = '0x123...';
43
-
44
- const { assetsData } = await getCompoundV3MarketsData(
45
- web3, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
46
- 1, // network
47
- selectedMarket, // market object like in /src/markets/compound/index.ts
48
- web3, // this must be mainnet rpc - used for getting prices onchain and calculating apys
49
- );
50
-
51
- const userData = await getCompoundV3AccountData(
52
- web3,
53
- 1, // network
54
- userAddress, // EOA or DSProxy
55
- '', // proxy address of the user, or just empty string if checking for EOA
56
- {
57
- selectedMarket, // market object as in /src/markets/compound/index.ts
58
- assetsData,
59
- }
60
- );
61
- ```
62
-
63
- More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
64
-
65
- ## Testing
66
-
67
- `npm run test` - Run all tests
68
-
69
- `npm run test-single --name=your_test_name` - Run single test for specified name e.g. for MyTest.js test name is MyTest
1
+ # DeFi Saver Positions SDK
2
+
3
+ Supported protocols:
4
+ - [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
5
+ - [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
6
+ - [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
7
+ - [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
8
+ - [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
9
+ - [Morpho Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV2)
10
+ - [Morpho Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV3)
11
+ - [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
12
+ - [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
13
+ - [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
14
+ - [Chicken Bonds](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/chickenBonds)
15
+
16
+ ## Setup
17
+ Supported Node version is v10.
18
+
19
+ - run `npm install` (first time)
20
+ - run `npm run build`
21
+
22
+ `build` command will generate contracts and build ejs and esm folders
23
+
24
+ ## How to use
25
+ [All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
26
+
27
+ This is a Compound V3 example, and every other protocol is similar
28
+ ```js
29
+ import Web3 from 'web3';
30
+ import { compoundV3 } from '@defisaver/positions-sdk';
31
+
32
+
33
+ // every protocol has market data and user data getters
34
+ const {
35
+ getCompoundV3MarketsData,
36
+ getCompoundV3AccountData,
37
+ } = compoundV3;
38
+
39
+ const provider = 'Your RPC provider';
40
+ const web3 = new Web3(provider);
41
+
42
+ const user = '0x123...';
43
+
44
+ const { assetsData } = await getCompoundV3MarketsData(
45
+ web3, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
46
+ 1, // network
47
+ selectedMarket, // market object like in /src/markets/compound/index.ts
48
+ web3, // this must be mainnet rpc - used for getting prices onchain and calculating apys
49
+ );
50
+
51
+ const userData = await getCompoundV3AccountData(
52
+ web3,
53
+ 1, // network
54
+ userAddress, // EOA or DSProxy
55
+ '', // proxy address of the user, or just empty string if checking for EOA
56
+ {
57
+ selectedMarket, // market object as in /src/markets/compound/index.ts
58
+ assetsData,
59
+ }
60
+ );
61
+ ```
62
+
63
+ More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
64
+
65
+ ## Testing
66
+
67
+ `npm run test` - Run all tests
68
+
69
+ `npm run test-single --name=your_test_name` - Run single test for specified name e.g. for MyTest.js test name is MyTest
@@ -59,3 +59,7 @@ export declare const getFluidDepositData: (web3: Web3, network: NetworkNumber, t
59
59
  deposited: string;
60
60
  depositedShares: string;
61
61
  }>;
62
+ export declare const getUserPositions: (web3: Web3, network: NetworkNumber, user: EthAddress) => Promise<{
63
+ marketData: FluidMarketData;
64
+ userData: FluidVaultData;
65
+ }[]>;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getFluidDepositData = exports.getFluidTokenData = exports.getAllFluidMarketDataChunked = exports.getFluidPositionWithMarket = exports.getFluidPosition = exports.getFluidVaultIdsForUser = exports.getFluidMarketData = exports.EMPTY_FLUID_DATA = exports.EMPTY_USED_ASSET = void 0;
15
+ exports.getUserPositions = exports.getFluidDepositData = exports.getFluidTokenData = exports.getAllFluidMarketDataChunked = exports.getFluidPositionWithMarket = exports.getFluidPosition = exports.getFluidVaultIdsForUser = exports.getFluidMarketData = exports.EMPTY_FLUID_DATA = exports.EMPTY_USED_ASSET = void 0;
16
16
  const decimal_js_1 = __importDefault(require("decimal.js"));
17
17
  const tokens_1 = require("@defisaver/tokens");
18
18
  const common_1 = require("../types/common");
@@ -261,3 +261,14 @@ const getFluidDepositData = (web3, network, token, address) => __awaiter(void 0,
261
261
  };
262
262
  });
263
263
  exports.getFluidDepositData = getFluidDepositData;
264
+ const getUserPositions = (web3, network, user) => __awaiter(void 0, void 0, void 0, function* () {
265
+ const view = (0, contracts_1.FluidViewContract)(web3, network);
266
+ const data = yield view.methods.getUserPositions(user).call();
267
+ const parsedMarketData = yield Promise.all(data.vaults.map((vaultData) => __awaiter(void 0, void 0, void 0, function* () { return parseMarketData(web3, vaultData, network); })));
268
+ const userData = data.positions.map((position, i) => parseUserData(position, parsedMarketData[i]));
269
+ return parsedMarketData.map((market, i) => ({
270
+ marketData: market,
271
+ userData: userData[i],
272
+ }));
273
+ });
274
+ exports.getUserPositions = getUserPositions;
@@ -115,73 +115,73 @@ const getApyAfterValuesEstimation = (selectedMarket, actions, web3, network) =>
115
115
  });
116
116
  exports.getApyAfterValuesEstimation = getApyAfterValuesEstimation;
117
117
  const API_URL = 'https://blue-api.morpho.org/graphql';
118
- const MARKET_QUERY = `
119
- query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
120
- marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
121
- reallocatableLiquidityAssets
122
- targetBorrowUtilization
123
- loanAsset {
124
- address
125
- decimals
126
- priceUsd
127
- }
128
- state {
129
- liquidityAssets
130
- borrowAssets
131
- supplyAssets
132
- }
133
- publicAllocatorSharedLiquidity {
134
- assets
135
- vault {
136
- address
137
- name
138
- }
139
- allocationMarket {
140
- uniqueKey
141
- loanAsset {
142
- address
143
- }
144
- collateralAsset {
145
- address
146
- }
147
- irmAddress
148
- oracle {
149
- address
150
- }
151
- lltv
152
- }
153
- }
154
- loanAsset {
155
- address
156
- }
157
- collateralAsset {
158
- address
159
- }
160
- oracle {
161
- address
162
- }
163
- irmAddress
164
- lltv
165
- }
166
- }
118
+ const MARKET_QUERY = `
119
+ query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
120
+ marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
121
+ reallocatableLiquidityAssets
122
+ targetBorrowUtilization
123
+ loanAsset {
124
+ address
125
+ decimals
126
+ priceUsd
127
+ }
128
+ state {
129
+ liquidityAssets
130
+ borrowAssets
131
+ supplyAssets
132
+ }
133
+ publicAllocatorSharedLiquidity {
134
+ assets
135
+ vault {
136
+ address
137
+ name
138
+ }
139
+ allocationMarket {
140
+ uniqueKey
141
+ loanAsset {
142
+ address
143
+ }
144
+ collateralAsset {
145
+ address
146
+ }
147
+ irmAddress
148
+ oracle {
149
+ address
150
+ }
151
+ lltv
152
+ }
153
+ }
154
+ loanAsset {
155
+ address
156
+ }
157
+ collateralAsset {
158
+ address
159
+ }
160
+ oracle {
161
+ address
162
+ }
163
+ irmAddress
164
+ lltv
165
+ }
166
+ }
167
167
  `;
168
- const REWARDS_QUERY = `
169
- query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
170
- marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
171
- uniqueKey
172
- state {
173
- rewards {
174
- amountPerSuppliedToken
175
- supplyApr
176
- amountPerBorrowedToken
177
- borrowApr
178
- asset {
179
- address
180
- }
181
- }
182
- }
183
- }
184
- }
168
+ const REWARDS_QUERY = `
169
+ query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
170
+ marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
171
+ uniqueKey
172
+ state {
173
+ rewards {
174
+ amountPerSuppliedToken
175
+ supplyApr
176
+ amountPerBorrowedToken
177
+ borrowApr
178
+ asset {
179
+ address
180
+ }
181
+ }
182
+ }
183
+ }
184
+ }
185
185
  `;
186
186
  /**
187
187
  * Get reallocatable liquidity to a given market and target borrow utilization
@@ -21,6 +21,7 @@ const ETH_USDC_1 = (networkId = common_1.NetworkNumber.Eth) => ({
21
21
  collateralAsset: 'ETH',
22
22
  debtAsset: 'USDC',
23
23
  type: types_1.FluidVaultType.T1,
24
+ isDeprecatingSoon: true,
24
25
  });
25
26
  exports.ETH_USDC_1 = ETH_USDC_1;
26
27
  const ETH_USDT_2 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -40,6 +41,7 @@ const ETH_USDT_2 = (networkId = common_1.NetworkNumber.Eth) => ({
40
41
  collateralAsset: 'ETH',
41
42
  debtAsset: 'USDT',
42
43
  type: types_1.FluidVaultType.T1,
44
+ isDeprecatingSoon: true,
43
45
  });
44
46
  exports.ETH_USDT_2 = ETH_USDT_2;
45
47
  const WSTETH_ETH_3 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -59,6 +61,7 @@ const WSTETH_ETH_3 = (networkId = common_1.NetworkNumber.Eth) => ({
59
61
  collateralAsset: 'wstETH',
60
62
  debtAsset: 'ETH',
61
63
  type: types_1.FluidVaultType.T1,
64
+ isDeprecatingSoon: true,
62
65
  });
63
66
  exports.WSTETH_ETH_3 = WSTETH_ETH_3;
64
67
  const WSTETH_USDC_4 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -78,6 +81,7 @@ const WSTETH_USDC_4 = (networkId = common_1.NetworkNumber.Eth) => ({
78
81
  collateralAsset: 'wstETH',
79
82
  debtAsset: 'USDC',
80
83
  type: types_1.FluidVaultType.T1,
84
+ isDeprecatingSoon: true,
81
85
  });
82
86
  exports.WSTETH_USDC_4 = WSTETH_USDC_4;
83
87
  const WSTETH_USDT_5 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -97,6 +101,7 @@ const WSTETH_USDT_5 = (networkId = common_1.NetworkNumber.Eth) => ({
97
101
  collateralAsset: 'wstETH',
98
102
  debtAsset: 'USDT',
99
103
  type: types_1.FluidVaultType.T1,
104
+ isDeprecatingSoon: true,
100
105
  });
101
106
  exports.WSTETH_USDT_5 = WSTETH_USDT_5;
102
107
  const WEETH_WSTETH_6 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -116,6 +121,7 @@ const WEETH_WSTETH_6 = (networkId = common_1.NetworkNumber.Eth) => ({
116
121
  collateralAsset: 'weETH',
117
122
  debtAsset: 'wstETH',
118
123
  type: types_1.FluidVaultType.T1,
124
+ isDeprecatingSoon: true,
119
125
  });
120
126
  exports.WEETH_WSTETH_6 = WEETH_WSTETH_6;
121
127
  const WEETH_USDC_9 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -135,6 +141,7 @@ const WEETH_USDC_9 = (networkId = common_1.NetworkNumber.Eth) => ({
135
141
  debtAsset: 'USDC',
136
142
  type: types_1.FluidVaultType.T1,
137
143
  wstETHBased: false,
144
+ isDeprecatingSoon: true,
138
145
  });
139
146
  exports.WEETH_USDC_9 = WEETH_USDC_9;
140
147
  const WEETH_USDT_10 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -154,6 +161,7 @@ const WEETH_USDT_10 = (networkId = common_1.NetworkNumber.Eth) => ({
154
161
  hasSmartDebt: false,
155
162
  collateralAsset: 'weETH',
156
163
  debtAsset: 'USDT',
164
+ isDeprecatingSoon: true,
157
165
  });
158
166
  exports.WEETH_USDT_10 = WEETH_USDT_10;
159
167
  const ETH_USDC_11 = (networkId = common_1.NetworkNumber.Eth) => ({
@@ -16,6 +16,7 @@ export interface FluidMarketInfo {
16
16
  wstETHBased?: boolean;
17
17
  stableBased?: boolean;
18
18
  type: FluidVaultType;
19
+ isDeprecatingSoon?: boolean;
19
20
  }
20
21
  export declare enum FluidMainnetVersion {
21
22
  ETH_USDC_1 = "ETH_USDC_1",
@@ -59,3 +59,7 @@ export declare const getFluidDepositData: (web3: Web3, network: NetworkNumber, t
59
59
  deposited: string;
60
60
  depositedShares: string;
61
61
  }>;
62
+ export declare const getUserPositions: (web3: Web3, network: NetworkNumber, user: EthAddress) => Promise<{
63
+ marketData: FluidMarketData;
64
+ userData: FluidVaultData;
65
+ }[]>;
@@ -248,3 +248,13 @@ export const getFluidDepositData = (web3, network, token, address) => __awaiter(
248
248
  depositedShares: getEthAmountForDecimals(userPosition.fTokenShares, decimals),
249
249
  };
250
250
  });
251
+ export const getUserPositions = (web3, network, user) => __awaiter(void 0, void 0, void 0, function* () {
252
+ const view = FluidViewContract(web3, network);
253
+ const data = yield view.methods.getUserPositions(user).call();
254
+ const parsedMarketData = yield Promise.all(data.vaults.map((vaultData) => __awaiter(void 0, void 0, void 0, function* () { return parseMarketData(web3, vaultData, network); })));
255
+ const userData = data.positions.map((position, i) => parseUserData(position, parsedMarketData[i]));
256
+ return parsedMarketData.map((market, i) => ({
257
+ marketData: market,
258
+ userData: userData[i],
259
+ }));
260
+ });
@@ -105,73 +105,73 @@ export const getApyAfterValuesEstimation = (selectedMarket, actions, web3, netwo
105
105
  return { borrowRate, supplyRate };
106
106
  });
107
107
  const API_URL = 'https://blue-api.morpho.org/graphql';
108
- const MARKET_QUERY = `
109
- query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
110
- marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
111
- reallocatableLiquidityAssets
112
- targetBorrowUtilization
113
- loanAsset {
114
- address
115
- decimals
116
- priceUsd
117
- }
118
- state {
119
- liquidityAssets
120
- borrowAssets
121
- supplyAssets
122
- }
123
- publicAllocatorSharedLiquidity {
124
- assets
125
- vault {
126
- address
127
- name
128
- }
129
- allocationMarket {
130
- uniqueKey
131
- loanAsset {
132
- address
133
- }
134
- collateralAsset {
135
- address
136
- }
137
- irmAddress
138
- oracle {
139
- address
140
- }
141
- lltv
142
- }
143
- }
144
- loanAsset {
145
- address
146
- }
147
- collateralAsset {
148
- address
149
- }
150
- oracle {
151
- address
152
- }
153
- irmAddress
154
- lltv
155
- }
156
- }
108
+ const MARKET_QUERY = `
109
+ query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
110
+ marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
111
+ reallocatableLiquidityAssets
112
+ targetBorrowUtilization
113
+ loanAsset {
114
+ address
115
+ decimals
116
+ priceUsd
117
+ }
118
+ state {
119
+ liquidityAssets
120
+ borrowAssets
121
+ supplyAssets
122
+ }
123
+ publicAllocatorSharedLiquidity {
124
+ assets
125
+ vault {
126
+ address
127
+ name
128
+ }
129
+ allocationMarket {
130
+ uniqueKey
131
+ loanAsset {
132
+ address
133
+ }
134
+ collateralAsset {
135
+ address
136
+ }
137
+ irmAddress
138
+ oracle {
139
+ address
140
+ }
141
+ lltv
142
+ }
143
+ }
144
+ loanAsset {
145
+ address
146
+ }
147
+ collateralAsset {
148
+ address
149
+ }
150
+ oracle {
151
+ address
152
+ }
153
+ irmAddress
154
+ lltv
155
+ }
156
+ }
157
157
  `;
158
- const REWARDS_QUERY = `
159
- query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
160
- marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
161
- uniqueKey
162
- state {
163
- rewards {
164
- amountPerSuppliedToken
165
- supplyApr
166
- amountPerBorrowedToken
167
- borrowApr
168
- asset {
169
- address
170
- }
171
- }
172
- }
173
- }
174
- }
158
+ const REWARDS_QUERY = `
159
+ query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
160
+ marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
161
+ uniqueKey
162
+ state {
163
+ rewards {
164
+ amountPerSuppliedToken
165
+ supplyApr
166
+ amountPerBorrowedToken
167
+ borrowApr
168
+ asset {
169
+ address
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
175
  `;
176
176
  /**
177
177
  * Get reallocatable liquidity to a given market and target borrow utilization
@@ -17,6 +17,7 @@ export const ETH_USDC_1 = (networkId = NetworkNumber.Eth) => ({
17
17
  collateralAsset: 'ETH',
18
18
  debtAsset: 'USDC',
19
19
  type: FluidVaultType.T1,
20
+ isDeprecatingSoon: true,
20
21
  });
21
22
  export const ETH_USDT_2 = (networkId = NetworkNumber.Eth) => ({
22
23
  btcBased: false,
@@ -35,6 +36,7 @@ export const ETH_USDT_2 = (networkId = NetworkNumber.Eth) => ({
35
36
  collateralAsset: 'ETH',
36
37
  debtAsset: 'USDT',
37
38
  type: FluidVaultType.T1,
39
+ isDeprecatingSoon: true,
38
40
  });
39
41
  export const WSTETH_ETH_3 = (networkId = NetworkNumber.Eth) => ({
40
42
  stableBased: false,
@@ -53,6 +55,7 @@ export const WSTETH_ETH_3 = (networkId = NetworkNumber.Eth) => ({
53
55
  collateralAsset: 'wstETH',
54
56
  debtAsset: 'ETH',
55
57
  type: FluidVaultType.T1,
58
+ isDeprecatingSoon: true,
56
59
  });
57
60
  export const WSTETH_USDC_4 = (networkId = NetworkNumber.Eth) => ({
58
61
  btcBased: false,
@@ -71,6 +74,7 @@ export const WSTETH_USDC_4 = (networkId = NetworkNumber.Eth) => ({
71
74
  collateralAsset: 'wstETH',
72
75
  debtAsset: 'USDC',
73
76
  type: FluidVaultType.T1,
77
+ isDeprecatingSoon: true,
74
78
  });
75
79
  export const WSTETH_USDT_5 = (networkId = NetworkNumber.Eth) => ({
76
80
  btcBased: false,
@@ -89,6 +93,7 @@ export const WSTETH_USDT_5 = (networkId = NetworkNumber.Eth) => ({
89
93
  collateralAsset: 'wstETH',
90
94
  debtAsset: 'USDT',
91
95
  type: FluidVaultType.T1,
96
+ isDeprecatingSoon: true,
92
97
  });
93
98
  export const WEETH_WSTETH_6 = (networkId = NetworkNumber.Eth) => ({
94
99
  btcBased: false,
@@ -107,6 +112,7 @@ export const WEETH_WSTETH_6 = (networkId = NetworkNumber.Eth) => ({
107
112
  collateralAsset: 'weETH',
108
113
  debtAsset: 'wstETH',
109
114
  type: FluidVaultType.T1,
115
+ isDeprecatingSoon: true,
110
116
  });
111
117
  export const WEETH_USDC_9 = (networkId = NetworkNumber.Eth) => ({
112
118
  btcBased: false,
@@ -125,6 +131,7 @@ export const WEETH_USDC_9 = (networkId = NetworkNumber.Eth) => ({
125
131
  debtAsset: 'USDC',
126
132
  type: FluidVaultType.T1,
127
133
  wstETHBased: false,
134
+ isDeprecatingSoon: true,
128
135
  });
129
136
  export const WEETH_USDT_10 = (networkId = NetworkNumber.Eth) => ({
130
137
  btcBased: false,
@@ -143,6 +150,7 @@ export const WEETH_USDT_10 = (networkId = NetworkNumber.Eth) => ({
143
150
  hasSmartDebt: false,
144
151
  collateralAsset: 'weETH',
145
152
  debtAsset: 'USDT',
153
+ isDeprecatingSoon: true,
146
154
  });
147
155
  export const ETH_USDC_11 = (networkId = NetworkNumber.Eth) => ({
148
156
  btcBased: false,
@@ -16,6 +16,7 @@ export interface FluidMarketInfo {
16
16
  wstETHBased?: boolean;
17
17
  stableBased?: boolean;
18
18
  type: FluidVaultType;
19
+ isDeprecatingSoon?: boolean;
19
20
  }
20
21
  export declare enum FluidMainnetVersion {
21
22
  ETH_USDC_1 = "ETH_USDC_1",