@defisaver/positions-sdk 2.1.29 → 2.1.31-syrup-dev

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 (133) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/CLAUDE.md +32 -0
  4. package/README.md +64 -64
  5. package/cjs/config/contracts.d.ts +57 -0
  6. package/cjs/config/contracts.js +4 -1
  7. package/cjs/contracts.d.ts +46351 -0
  8. package/cjs/contracts.js +20 -2
  9. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  10. package/cjs/markets/aave/marketAssets.js +2 -2
  11. package/cjs/savings/index.d.ts +4 -3
  12. package/cjs/savings/index.js +9 -1
  13. package/cjs/savings/morphoVaults/index.js +17 -17
  14. package/cjs/savings/sparkSavingsVaults/index.d.ts +7 -0
  15. package/cjs/savings/sparkSavingsVaults/index.js +98 -0
  16. package/cjs/savings/sparkSavingsVaults/options.d.ts +6 -0
  17. package/cjs/savings/sparkSavingsVaults/options.js +35 -0
  18. package/cjs/types/savings/index.d.ts +3 -1
  19. package/cjs/types/savings/index.js +1 -0
  20. package/cjs/types/savings/sparkSavingsVaults.d.ts +14 -0
  21. package/cjs/types/savings/sparkSavingsVaults.js +9 -0
  22. package/esm/config/contracts.d.ts +57 -0
  23. package/esm/config/contracts.js +3 -0
  24. package/esm/contracts.d.ts +46351 -0
  25. package/esm/contracts.js +16 -0
  26. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  27. package/esm/markets/aave/marketAssets.js +2 -2
  28. package/esm/savings/index.d.ts +4 -3
  29. package/esm/savings/index.js +8 -1
  30. package/esm/savings/morphoVaults/index.js +17 -17
  31. package/esm/savings/sparkSavingsVaults/index.d.ts +7 -0
  32. package/esm/savings/sparkSavingsVaults/index.js +57 -0
  33. package/esm/savings/sparkSavingsVaults/options.d.ts +6 -0
  34. package/esm/savings/sparkSavingsVaults/options.js +31 -0
  35. package/esm/types/savings/index.d.ts +3 -1
  36. package/esm/types/savings/index.js +1 -0
  37. package/esm/types/savings/sparkSavingsVaults.d.ts +14 -0
  38. package/esm/types/savings/sparkSavingsVaults.js +6 -0
  39. package/package.json +48 -48
  40. package/src/aaveV2/index.ts +240 -240
  41. package/src/aaveV3/index.ts +614 -614
  42. package/src/aaveV3/merit.ts +97 -97
  43. package/src/aaveV3/merkl.ts +74 -74
  44. package/src/claiming/aaveV3.ts +154 -154
  45. package/src/claiming/compV3.ts +22 -22
  46. package/src/claiming/ethena.ts +61 -61
  47. package/src/claiming/index.ts +12 -12
  48. package/src/claiming/king.ts +66 -66
  49. package/src/claiming/morphoBlue.ts +118 -118
  50. package/src/claiming/spark.ts +225 -225
  51. package/src/compoundV2/index.ts +244 -244
  52. package/src/compoundV3/index.ts +274 -274
  53. package/src/config/contracts.ts +1285 -1282
  54. package/src/constants/index.ts +10 -10
  55. package/src/contracts.ts +160 -142
  56. package/src/curveUsd/index.ts +254 -254
  57. package/src/eulerV2/index.ts +324 -324
  58. package/src/exchange/index.ts +25 -25
  59. package/src/fluid/index.ts +1800 -1800
  60. package/src/helpers/aaveHelpers/index.ts +187 -187
  61. package/src/helpers/compoundHelpers/index.ts +283 -283
  62. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  63. package/src/helpers/eulerHelpers/index.ts +222 -222
  64. package/src/helpers/fluidHelpers/index.ts +326 -326
  65. package/src/helpers/index.ts +10 -10
  66. package/src/helpers/liquityV2Helpers/index.ts +82 -82
  67. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  68. package/src/helpers/makerHelpers/index.ts +52 -52
  69. package/src/helpers/morphoBlueHelpers/index.ts +396 -396
  70. package/src/helpers/sparkHelpers/index.ts +158 -158
  71. package/src/index.ts +49 -49
  72. package/src/liquity/index.ts +159 -159
  73. package/src/liquityV2/index.ts +703 -703
  74. package/src/llamaLend/index.ts +305 -305
  75. package/src/maker/index.ts +223 -223
  76. package/src/markets/aave/index.ts +118 -118
  77. package/src/markets/aave/marketAssets.ts +54 -54
  78. package/src/markets/compound/index.ts +243 -243
  79. package/src/markets/compound/marketsAssets.ts +97 -97
  80. package/src/markets/curveUsd/index.ts +69 -69
  81. package/src/markets/euler/index.ts +26 -26
  82. package/src/markets/fluid/index.ts +2900 -2900
  83. package/src/markets/index.ts +25 -25
  84. package/src/markets/liquityV2/index.ts +102 -102
  85. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  86. package/src/markets/llamaLend/index.ts +235 -235
  87. package/src/markets/morphoBlue/index.ts +971 -971
  88. package/src/markets/spark/index.ts +29 -29
  89. package/src/markets/spark/marketAssets.ts +12 -12
  90. package/src/moneymarket/moneymarketCommonService.ts +85 -85
  91. package/src/morphoBlue/index.ts +274 -274
  92. package/src/portfolio/index.ts +598 -598
  93. package/src/savings/index.ts +55 -46
  94. package/src/savings/makerDsr/index.ts +53 -53
  95. package/src/savings/makerDsr/options.ts +9 -9
  96. package/src/savings/morphoVaults/index.ts +80 -80
  97. package/src/savings/morphoVaults/options.ts +203 -203
  98. package/src/savings/sparkSavingsVaults/index.ts +61 -0
  99. package/src/savings/sparkSavingsVaults/options.ts +36 -0
  100. package/src/savings/yearnVaults/index.ts +73 -73
  101. package/src/savings/yearnVaults/options.ts +32 -32
  102. package/src/services/priceService.ts +278 -278
  103. package/src/services/utils.ts +115 -115
  104. package/src/services/viem.ts +34 -34
  105. package/src/setup.ts +8 -8
  106. package/src/spark/index.ts +456 -456
  107. package/src/staking/eligibility.ts +53 -53
  108. package/src/staking/index.ts +1 -1
  109. package/src/staking/staking.ts +186 -186
  110. package/src/types/aave.ts +196 -196
  111. package/src/types/claiming.ts +114 -114
  112. package/src/types/common.ts +107 -107
  113. package/src/types/compound.ts +144 -144
  114. package/src/types/curveUsd.ts +123 -123
  115. package/src/types/euler.ts +175 -175
  116. package/src/types/fluid.ts +483 -483
  117. package/src/types/index.ts +14 -14
  118. package/src/types/liquity.ts +30 -30
  119. package/src/types/liquityV2.ts +126 -126
  120. package/src/types/llamaLend.ts +159 -159
  121. package/src/types/maker.ts +63 -63
  122. package/src/types/merit.ts +1 -1
  123. package/src/types/merkl.ts +70 -70
  124. package/src/types/morphoBlue.ts +200 -200
  125. package/src/types/portfolio.ts +60 -60
  126. package/src/types/savings/index.ts +20 -18
  127. package/src/types/savings/makerDsr.ts +13 -13
  128. package/src/types/savings/morphoVaults.ts +33 -33
  129. package/src/types/savings/sparkSavingsVaults.ts +16 -0
  130. package/src/types/savings/yearnVaults.ts +14 -14
  131. package/src/types/spark.ts +133 -133
  132. package/src/umbrella/index.ts +69 -69
  133. package/src/umbrella/umbrellaUtils.ts +29 -29
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/CLAUDE.md ADDED
@@ -0,0 +1,32 @@
1
+ # DeFiSaver Positions SDK
2
+
3
+ TypeScript SDK for DeFi positions tracking and management.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ # Development
9
+ npm run dev # Watch mode compilation
10
+ npm run build # Lint and build both CJS and ESM
11
+ npm run build:cjs # Build CommonJS
12
+ npm run build:esm # Build ES modules
13
+
14
+ # Linting
15
+ npm run lint # Lint and fix
16
+ npm run lint-check # Lint without fixing
17
+
18
+ # Testing
19
+ npm run test # Run all tests
20
+ npm run test-single # Run single test (use --name=filename)
21
+ npm run test:debugger # Run tests with debugger
22
+
23
+ # Versioning
24
+ npm run version-bump # Commit and bump patch version
25
+ ```
26
+
27
+ ## Project Structure
28
+
29
+ - `src/` - TypeScript source code
30
+ - `tests/` - Test files
31
+ - `esm/` - ES module build output
32
+ - `cjs/` - CommonJS build output
package/README.md CHANGED
@@ -1,64 +1,64 @@
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
- - [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
10
- - [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
11
- - [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
12
-
13
- ## Setup
14
- Supported Node version is v10.
15
-
16
- - run `npm install` (first time)
17
- - run `npm run build`
18
-
19
- `build` command will generate contracts and build ejs and esm folders
20
-
21
- ## How to use
22
- [All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
23
-
24
- This is a Compound V3 example, and every other protocol is similar
25
- ```js
26
- import { compoundV3 } from '@defisaver/positions-sdk';
27
-
28
-
29
- // every protocol has market data and user data getters
30
- const {
31
- getCompoundV3MarketsData,
32
- getCompoundV3AccountData,
33
- } = compoundV3;
34
-
35
- const provider = 'Your RPC provider';
36
-
37
- const user = '0x123...';
38
-
39
- const { assetsData } = await getCompoundV3MarketsData(
40
- provider, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
41
- 1, // network
42
- selectedMarket, // market object like in /src/markets/compound/index.ts
43
- provider, // this must be mainnet rpc - used for getting prices onchain and calculating apys
44
- );
45
-
46
- const userData = await getCompoundV3AccountData(
47
- provider,
48
- 1, // network
49
- userAddress, // EOA or DSProxy
50
- '', // proxy address of the user, or just empty string if checking for EOA
51
- {
52
- selectedMarket, // market object as in /src/markets/compound/index.ts
53
- assetsData,
54
- }
55
- );
56
- ```
57
-
58
- More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
59
-
60
- ## Testing
61
-
62
- `npm run test` - Run all tests
63
-
64
- `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
+ - [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
10
+ - [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
11
+ - [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
12
+
13
+ ## Setup
14
+ Supported Node version is v10.
15
+
16
+ - run `npm install` (first time)
17
+ - run `npm run build`
18
+
19
+ `build` command will generate contracts and build ejs and esm folders
20
+
21
+ ## How to use
22
+ [All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
23
+
24
+ This is a Compound V3 example, and every other protocol is similar
25
+ ```js
26
+ import { compoundV3 } from '@defisaver/positions-sdk';
27
+
28
+
29
+ // every protocol has market data and user data getters
30
+ const {
31
+ getCompoundV3MarketsData,
32
+ getCompoundV3AccountData,
33
+ } = compoundV3;
34
+
35
+ const provider = 'Your RPC provider';
36
+
37
+ const user = '0x123...';
38
+
39
+ const { assetsData } = await getCompoundV3MarketsData(
40
+ provider, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
41
+ 1, // network
42
+ selectedMarket, // market object like in /src/markets/compound/index.ts
43
+ provider, // this must be mainnet rpc - used for getting prices onchain and calculating apys
44
+ );
45
+
46
+ const userData = await getCompoundV3AccountData(
47
+ provider,
48
+ 1, // network
49
+ userAddress, // EOA or DSProxy
50
+ '', // proxy address of the user, or just empty string if checking for EOA
51
+ {
52
+ selectedMarket, // market object as in /src/markets/compound/index.ts
53
+ assetsData,
54
+ }
55
+ );
56
+ ```
57
+
58
+ More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
59
+
60
+ ## Testing
61
+
62
+ `npm run test` - Run all tests
63
+
64
+ `npm run test-single --name=your_test_name` - Run single test for specified name e.g. for MyTest.js test name is MyTest
@@ -85335,3 +85335,60 @@ export declare const MakerDsr: {
85335
85335
  };
85336
85336
  };
85337
85337
  };
85338
+ export declare const SparkSavingsVault: {
85339
+ readonly abi: readonly [{
85340
+ readonly inputs: readonly [{
85341
+ readonly internalType: "address";
85342
+ readonly name: "";
85343
+ readonly type: "address";
85344
+ }];
85345
+ readonly name: "balanceOf";
85346
+ readonly outputs: readonly [{
85347
+ readonly internalType: "uint256";
85348
+ readonly name: "";
85349
+ readonly type: "uint256";
85350
+ }];
85351
+ readonly stateMutability: "view";
85352
+ readonly type: "function";
85353
+ }, {
85354
+ readonly inputs: readonly [];
85355
+ readonly name: "decimals";
85356
+ readonly outputs: readonly [{
85357
+ readonly internalType: "uint8";
85358
+ readonly name: "";
85359
+ readonly type: "uint8";
85360
+ }];
85361
+ readonly stateMutability: "view";
85362
+ readonly type: "function";
85363
+ }, {
85364
+ readonly inputs: readonly [];
85365
+ readonly name: "nowChi";
85366
+ readonly outputs: readonly [{
85367
+ readonly internalType: "uint256";
85368
+ readonly name: "";
85369
+ readonly type: "uint256";
85370
+ }];
85371
+ readonly stateMutability: "view";
85372
+ readonly type: "function";
85373
+ }, {
85374
+ readonly inputs: readonly [];
85375
+ readonly name: "RAY";
85376
+ readonly outputs: readonly [{
85377
+ readonly internalType: "uint256";
85378
+ readonly name: "";
85379
+ readonly type: "uint256";
85380
+ }];
85381
+ readonly stateMutability: "view";
85382
+ readonly type: "function";
85383
+ }, {
85384
+ readonly inputs: readonly [];
85385
+ readonly name: "totalAssets";
85386
+ readonly outputs: readonly [{
85387
+ readonly internalType: "uint256";
85388
+ readonly name: "";
85389
+ readonly type: "uint256";
85390
+ }];
85391
+ readonly stateMutability: "view";
85392
+ readonly type: "function";
85393
+ }];
85394
+ };
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.LiquityView = exports.crvUSDFactory = exports.crvUSDView = exports.crvUSDsfrxETHAmm = exports.crvUSDtBTCAmm = exports.crvUSDWBTCAmm = exports.crvUSDETHAmm = exports.crvUSDwstETHAmm = exports.crvUSDsfrxETHController = exports.crvUSDtBTCController = exports.crvUSDWBTCController = exports.crvUSDETHController = exports.crvUSDwstETHController = exports.SparkProtocolDataProvider = exports.SparkPoolAddressesProvider = exports.SparkLendingPool = exports.SparkIncentiveDataProvider = exports.SparkView = exports.Pot = exports.IAToken = exports.IVariableDebtToken = exports.Comptroller = exports.CompoundLoanInfo = exports.AaveLendingPoolV2 = exports.AaveProtocolDataProvider = exports.LendingPoolAddressesProvider = exports.AaveLoanInfoV2 = exports.wstETH = exports.CompV3BulkerL2 = exports.CompV3BulkerMainnetETH = exports.CompV3BulkerMainnetUSDC = exports.CompV3View = exports.cWstETHv3 = exports.cUSDSv3 = exports.cUSDTv3 = exports.cETHv3 = exports.cUSDbCv3 = exports.cUSDCev3 = exports.cUSDCv3 = exports.AaveUiIncentiveDataProviderV3 = exports.AaveV3EtherfiProtocolDataProvider = exports.AaveV3LidoProtocolDataProvider = exports.AaveV3ProtocolDataProvider = exports.AaveV3EtherfiLendingPool = exports.AaveV3LidoLendingPool = exports.AaveV3LendingPool = exports.AaveV3EtherfiPoolAddressesProvider = exports.AaveV3LidoPoolAddressesProvider = exports.AaveV3PoolAddressesProvider = exports.AaveV3View = void 0;
5
- exports.MakerDsr = exports.YearnView = exports.YearnVault = exports.MorphoVault = exports.StkAAVE = exports.LiquityV2sBoldVault = exports.LiquityV2ActivePool = exports.AaveRewardsController = exports.MorphoDistributor = exports.SparkRewardsController = exports.SparkAirdrop = exports.UUPS = exports.LiquityStabilityPool = exports.LiquityLQTYStaking = exports.AaveUmbrellaView = exports.Erc4626 = exports.Erc20 = exports.AaveIncentivesController = exports.McdCdpManager = exports.McdGetCdps = exports.FluidView = exports.LiquityV2StabilityPool = exports.EulerV2View = exports.LiquityV2TroveNFT = exports.LiquityV2CollSurplusPool = exports.LiquityV2View = exports.LiquityV2LegacyView = exports.LlamaLendControllerAbi = exports.LlamaLendView = exports.DFSFeedRegistry = exports.FeedRegistry = exports.MorphoBlueView = exports.WeETHPriceFeed = exports.WstETHPriceFeed = exports.USDCPriceFeed = exports.BTCPriceFeed = exports.ETHPriceFeed = exports.COMPPriceFeed = exports.McdDog = exports.McdJug = exports.McdVat = exports.McdSpotter = exports.McdView = exports.LiquityActivePool = exports.PriceFeed = exports.TroveManager = exports.CollSurplusPool = void 0;
5
+ exports.SparkSavingsVault = exports.MakerDsr = exports.YearnView = exports.YearnVault = exports.MorphoVault = exports.StkAAVE = exports.LiquityV2sBoldVault = exports.LiquityV2ActivePool = exports.AaveRewardsController = exports.MorphoDistributor = exports.SparkRewardsController = exports.SparkAirdrop = exports.UUPS = exports.LiquityStabilityPool = exports.LiquityLQTYStaking = exports.AaveUmbrellaView = exports.Erc4626 = exports.Erc20 = exports.AaveIncentivesController = exports.McdCdpManager = exports.McdGetCdps = exports.FluidView = exports.LiquityV2StabilityPool = exports.EulerV2View = exports.LiquityV2TroveNFT = exports.LiquityV2CollSurplusPool = exports.LiquityV2View = exports.LiquityV2LegacyView = exports.LlamaLendControllerAbi = exports.LlamaLendView = exports.DFSFeedRegistry = exports.FeedRegistry = exports.MorphoBlueView = exports.WeETHPriceFeed = exports.WstETHPriceFeed = exports.USDCPriceFeed = exports.BTCPriceFeed = exports.ETHPriceFeed = exports.COMPPriceFeed = exports.McdDog = exports.McdJug = exports.McdVat = exports.McdSpotter = exports.McdView = exports.LiquityActivePool = exports.PriceFeed = exports.TroveManager = exports.CollSurplusPool = void 0;
6
6
  exports.AaveV3View = {
7
7
  "abi": [{ "inputs": [], "name": "AAVE_REFERRAL_CODE", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_umbrella", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getAdditionalUmbrellaStakingData", "outputs": [{ "components": [{ "internalType": "address", "name": "stkToken", "type": "address" }, { "internalType": "uint256", "name": "totalShares", "type": "uint256" }, { "internalType": "address", "name": "stkUnderlyingToken", "type": "address" }, { "internalType": "address", "name": "aToken", "type": "address" }, { "internalType": "uint256", "name": "cooldownPeriod", "type": "uint256" }, { "internalType": "uint256", "name": "unstakeWindow", "type": "uint256" }, { "internalType": "uint256", "name": "stkTokenToWaTokenRate", "type": "uint256" }, { "internalType": "uint256", "name": "waTokenToATokenRate", "type": "uint256" }, { "internalType": "uint256[]", "name": "rewardsEmissionRates", "type": "uint256[]" }, { "internalType": "uint256", "name": "userCooldownAmount", "type": "uint256" }, { "internalType": "uint256", "name": "userEndOfCooldown", "type": "uint256" }, { "internalType": "uint256", "name": "userWithdrawalWindow", "type": "uint256" }], "internalType": "struct AaveV3View.UmbrellaStkData[]", "name": "retVal", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getAllEmodes", "outputs": [{ "components": [{ "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "uint128", "name": "collateralBitmap", "type": "uint128" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "uint128", "name": "borrowableBitmap", "type": "uint128" }], "internalType": "struct DataTypes.EModeCategoryNew[]", "name": "emodesData", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "components": [{ "internalType": "address", "name": "reserveAddress", "type": "address" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityTaken", "type": "uint256" }, { "internalType": "bool", "name": "isDebtAsset", "type": "bool" }], "internalType": "struct AaveV3View.LiquidityChangeParams[]", "name": "_reserveParams", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "components": [{ "internalType": "address", "name": "reserveAddress", "type": "address" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "variableBorrowRate", "type": "uint256" }], "internalType": "struct AaveV3View.EstimatedRates[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAssetPrice", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getCollFactors", "outputs": [{ "internalType": "uint256[]", "name": "collFactors", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "contract IPoolV3", "name": "lendingPool", "type": "address" }], "name": "getEModeCollateralFactor", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "contract IPoolV3", "name": "_lendingPool", "type": "address" }, { "internalType": "uint8", "name": "_id", "type": "uint8" }], "name": "getEmodeData", "outputs": [{ "components": [{ "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "uint128", "name": "collateralBitmap", "type": "uint128" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "uint128", "name": "borrowableBitmap", "type": "uint128" }], "internalType": "struct DataTypes.EModeCategoryNew", "name": "emodeData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokenAddresses", "type": "address[]" }], "name": "getFullTokensInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint16", "name": "assetId", "type": "uint16" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateVariable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateStable", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "availableLiquidity", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVar", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowStab", "type": "uint256" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationRatio", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "uint256", "name": "debtCeilingForIsolationMode", "type": "uint256" }, { "internalType": "uint256", "name": "isolationModeTotalDebt", "type": "uint256" }, { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "stableBorrowRateEnabled", "type": "bool" }, { "internalType": "bool", "name": "isolationModeBorrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "isSiloedForBorrowing", "type": "bool" }, { "internalType": "uint256", "name": "eModeCollateralFactor", "type": "uint256" }, { "internalType": "bool", "name": "isFlashLoanEnabled", "type": "bool" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "bool", "name": "isPaused", "type": "bool" }, { "internalType": "bool", "name": "isFrozen", "type": "bool" }, { "internalType": "address", "name": "debtTokenAddress", "type": "address" }], "internalType": "struct AaveV3View.TokenInfoFull[]", "name": "tokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getHealthFactor", "outputs": [{ "internalType": "uint256", "name": "healthFactor", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getLoanData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "ratio", "type": "uint128" }, { "internalType": "uint256", "name": "eMode", "type": "uint256" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "bool[]", "name": "enabledAsColl", "type": "bool[]" }, { "internalType": "address[]", "name": "borrowAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowStableAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowVariableAmounts", "type": "uint256[]" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }], "internalType": "struct AaveV3View.LoanData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getLoanDataArr", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint128", "name": "ratio", "type": "uint128" }, { "internalType": "uint256", "name": "eMode", "type": "uint256" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "bool[]", "name": "enabledAsColl", "type": "bool[]" }, { "internalType": "address[]", "name": "borrowAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowStableAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowVariableAmounts", "type": "uint256[]" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }], "internalType": "struct AaveV3View.LoanData[]", "name": "loans", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint256", "name": "data", "type": "uint256" }], "internalType": "struct DataTypes.ReserveConfigurationMap", "name": "self", "type": "tuple" }], "name": "getLtv", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getPrices", "outputs": [{ "internalType": "uint256[]", "name": "prices", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getRatios", "outputs": [{ "internalType": "uint256[]", "name": "ratios", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getSafetyRatio", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getTokenBalances", "outputs": [{ "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "borrowsStable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowsVariable", "type": "uint256" }, { "internalType": "uint256", "name": "stableBorrowRate", "type": "uint256" }, { "internalType": "bool", "name": "enabledAsCollateral", "type": "bool" }], "internalType": "struct AaveV3View.UserToken[]", "name": "userTokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getTokenInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint16", "name": "assetId", "type": "uint16" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateVariable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateStable", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "availableLiquidity", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVar", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowStab", "type": "uint256" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationRatio", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "uint256", "name": "debtCeilingForIsolationMode", "type": "uint256" }, { "internalType": "uint256", "name": "isolationModeTotalDebt", "type": "uint256" }, { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "stableBorrowRateEnabled", "type": "bool" }, { "internalType": "bool", "name": "isolationModeBorrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "isSiloedForBorrowing", "type": "bool" }, { "internalType": "uint256", "name": "eModeCollateralFactor", "type": "uint256" }, { "internalType": "bool", "name": "isFlashLoanEnabled", "type": "bool" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "bool", "name": "isPaused", "type": "bool" }, { "internalType": "bool", "name": "isFrozen", "type": "bool" }, { "internalType": "address", "name": "debtTokenAddress", "type": "address" }], "internalType": "struct AaveV3View.TokenInfoFull", "name": "_tokenInfo", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokenAddresses", "type": "address[]" }], "name": "getTokensInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }], "internalType": "struct AaveV3View.TokenInfo[]", "name": "tokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isBorrowAllowed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }],
8
8
  "networks": {
@@ -1282,3 +1282,6 @@ exports.MakerDsr = {
1282
1282
  }
1283
1283
  }
1284
1284
  };
1285
+ exports.SparkSavingsVault = {
1286
+ "abi": [{ "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nowChi", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RAY", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalAssets", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }]
1287
+ };