@defisaver/positions-sdk 0.0.59 → 0.0.61

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 (96) hide show
  1. package/README.md +63 -63
  2. package/cjs/aaveV3/index.js +2 -1
  3. package/cjs/config/contracts.d.ts +225 -282
  4. package/cjs/config/contracts.js +19 -15
  5. package/cjs/llamaLend/index.js +0 -3
  6. package/cjs/markets/compound/index.js +10 -10
  7. package/cjs/markets/compound/marketsAssets.d.ts +2 -1
  8. package/cjs/markets/compound/marketsAssets.js +3 -2
  9. package/{esm/types/contracts/generated/CompV3USDbCBulker.d.ts → cjs/types/contracts/generated/CompV3BulkerL2.d.ts} +3 -3
  10. package/cjs/types/contracts/generated/{CompV3ETHBulker.d.ts → CompV3BulkerMainnetETH.d.ts} +3 -3
  11. package/{esm/types/contracts/generated/CompV3USDCBulker.d.ts → cjs/types/contracts/generated/CompV3BulkerMainnetUSDC.d.ts} +3 -3
  12. package/cjs/types/contracts/generated/index.d.ts +3 -4
  13. package/esm/aaveV3/index.js +2 -1
  14. package/esm/config/contracts.d.ts +225 -282
  15. package/esm/config/contracts.js +19 -15
  16. package/esm/llamaLend/index.js +0 -3
  17. package/esm/markets/compound/index.js +10 -10
  18. package/esm/markets/compound/marketsAssets.d.ts +2 -1
  19. package/esm/markets/compound/marketsAssets.js +2 -1
  20. package/{cjs/types/contracts/generated/CompV3USDbCBulker.d.ts → esm/types/contracts/generated/CompV3BulkerL2.d.ts} +3 -3
  21. package/esm/types/contracts/generated/{CompV3ETHBulker.d.ts → CompV3BulkerMainnetETH.d.ts} +3 -3
  22. package/{cjs/types/contracts/generated/CompV3USDCBulker.d.ts → esm/types/contracts/generated/CompV3BulkerMainnetUSDC.d.ts} +3 -3
  23. package/esm/types/contracts/generated/index.d.ts +3 -4
  24. package/package.json +40 -40
  25. package/src/aaveV2/index.ts +227 -227
  26. package/src/aaveV3/index.ts +562 -561
  27. package/src/assets/index.ts +60 -60
  28. package/src/chickenBonds/index.ts +123 -123
  29. package/src/compoundV2/index.ts +219 -219
  30. package/src/compoundV3/index.ts +273 -273
  31. package/src/config/contracts.js +855 -851
  32. package/src/constants/index.ts +5 -5
  33. package/src/contracts.ts +126 -126
  34. package/src/curveUsd/index.ts +229 -229
  35. package/src/exchange/index.ts +17 -17
  36. package/src/helpers/aaveHelpers/index.ts +134 -134
  37. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  38. package/src/helpers/compoundHelpers/index.ts +181 -181
  39. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  40. package/src/helpers/index.ts +7 -7
  41. package/src/helpers/llamaLendHelpers/index.ts +45 -45
  42. package/src/helpers/makerHelpers/index.ts +94 -94
  43. package/src/helpers/morphoBlueHelpers/index.ts +56 -56
  44. package/src/helpers/sparkHelpers/index.ts +106 -106
  45. package/src/index.ts +46 -46
  46. package/src/liquity/index.ts +116 -116
  47. package/src/llamaLend/index.ts +276 -279
  48. package/src/maker/index.ts +117 -117
  49. package/src/markets/aave/index.ts +80 -80
  50. package/src/markets/aave/marketAssets.ts +24 -24
  51. package/src/markets/compound/index.ts +141 -141
  52. package/src/markets/compound/marketsAssets.ts +49 -48
  53. package/src/markets/curveUsd/index.ts +69 -69
  54. package/src/markets/index.ts +5 -5
  55. package/src/markets/llamaLend/index.ts +65 -65
  56. package/src/markets/morphoBlue/index.ts +262 -262
  57. package/src/markets/spark/index.ts +29 -29
  58. package/src/markets/spark/marketAssets.ts +10 -10
  59. package/src/moneymarket/moneymarketCommonService.ts +75 -75
  60. package/src/morphoAaveV2/index.ts +256 -256
  61. package/src/morphoAaveV3/index.ts +619 -619
  62. package/src/morphoBlue/index.ts +177 -177
  63. package/src/multicall/index.ts +22 -22
  64. package/src/services/dsrService.ts +15 -15
  65. package/src/services/priceService.ts +21 -21
  66. package/src/services/utils.ts +51 -51
  67. package/src/setup.ts +8 -8
  68. package/src/spark/index.ts +422 -422
  69. package/src/staking/staking.ts +174 -174
  70. package/src/types/aave.ts +256 -256
  71. package/src/types/chickenBonds.ts +45 -45
  72. package/src/types/common.ts +83 -83
  73. package/src/types/compound.ts +128 -128
  74. package/src/types/contracts/generated/{CompV3USDbCBulker.ts → CompV3BulkerL2.ts} +3 -3
  75. package/src/types/contracts/generated/{CompV3ETHBulker.ts → CompV3BulkerMainnetETH.ts} +3 -3
  76. package/src/types/contracts/generated/{CompV3USDCBulker.ts → CompV3BulkerMainnetUSDC.ts} +3 -3
  77. package/src/types/contracts/generated/index.ts +3 -4
  78. package/src/types/curveUsd.ts +118 -118
  79. package/src/types/index.ts +8 -8
  80. package/src/types/liquity.ts +30 -30
  81. package/src/types/llamaLend.ts +119 -119
  82. package/src/types/maker.ts +50 -50
  83. package/src/types/morphoBlue.ts +107 -107
  84. package/src/types/spark.ts +106 -106
  85. package/yarn-error.log +64 -0
  86. package/cjs/types/contracts/generated/CompV3USDCBulkerArb.d.ts +0 -41
  87. package/cjs/types/contracts/generated/CompV3USDbCBulker.js +0 -5
  88. package/esm/types/contracts/generated/CompV3USDCBulkerArb.d.ts +0 -41
  89. package/esm/types/contracts/generated/CompV3USDbCBulker.js +0 -4
  90. package/src/types/contracts/generated/CompV3USDCBulkerArb.ts +0 -85
  91. /package/cjs/types/contracts/generated/{CompV3ETHBulker.js → CompV3BulkerL2.js} +0 -0
  92. /package/cjs/types/contracts/generated/{CompV3USDCBulker.js → CompV3BulkerMainnetETH.js} +0 -0
  93. /package/cjs/types/contracts/generated/{CompV3USDCBulkerArb.js → CompV3BulkerMainnetUSDC.js} +0 -0
  94. /package/esm/types/contracts/generated/{CompV3ETHBulker.js → CompV3BulkerL2.js} +0 -0
  95. /package/esm/types/contracts/generated/{CompV3USDCBulker.js → CompV3BulkerMainnetETH.js} +0 -0
  96. /package/esm/types/contracts/generated/{CompV3USDCBulkerArb.js → CompV3BulkerMainnetUSDC.js} +0 -0
@@ -150,8 +150,17 @@ module.exports = {
150
150
  "AaveUiIncentiveDataProviderV3": {
151
151
  "abi": [{ "inputs": [{ "internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address" }], "name": "getReservesIncentivesData", "outputs": [{ "components": [{ "internalType": "address", "name": "underlyingAsset", "type": "address" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "uint256", "name": "emissionPerSecond", "type": "uint256" }, { "internalType": "uint256", "name": "incentivesLastUpdateTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesIndex", "type": "uint256" }, { "internalType": "uint256", "name": "emissionEndTimestamp", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "precision", "type": "uint8" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]", "name": "rewardsTokenInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.IncentiveData", "name": "aIncentiveData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "uint256", "name": "emissionPerSecond", "type": "uint256" }, { "internalType": "uint256", "name": "incentivesLastUpdateTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesIndex", "type": "uint256" }, { "internalType": "uint256", "name": "emissionEndTimestamp", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "precision", "type": "uint8" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]", "name": "rewardsTokenInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.IncentiveData", "name": "vIncentiveData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "uint256", "name": "emissionPerSecond", "type": "uint256" }, { "internalType": "uint256", "name": "incentivesLastUpdateTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesIndex", "type": "uint256" }, { "internalType": "uint256", "name": "emissionEndTimestamp", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "precision", "type": "uint8" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]", "name": "rewardsTokenInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.IncentiveData", "name": "sIncentiveData", "type": "tuple" }], "internalType": "struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address" }, { "internalType": "address", "name": "user", "type": "address" }], "name": "getUserReservesIncentivesData", "outputs": [{ "components": [{ "internalType": "address", "name": "underlyingAsset", "type": "address" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "userUnclaimedRewards", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesUserIndex", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]", "name": "userRewardsInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData", "name": "aTokenIncentivesUserData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "userUnclaimedRewards", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesUserIndex", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]", "name": "userRewardsInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData", "name": "vTokenIncentivesUserData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "address", "name": "incentiveControllerAddress", "type": "address" }, { "components": [{ "internalType": "string", "name": "rewardTokenSymbol", "type": "string" }, { "internalType": "address", "name": "rewardOracleAddress", "type": "address" }, { "internalType": "address", "name": "rewardTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "userUnclaimedRewards", "type": "uint256" }, { "internalType": "uint256", "name": "tokenIncentivesUserIndex", "type": "uint256" }, { "internalType": "int256", "name": "rewardPriceFeed", "type": "int256" }, { "internalType": "uint8", "name": "priceFeedDecimals", "type": "uint8" }, { "internalType": "uint8", "name": "rewardTokenDecimals", "type": "uint8" }], "internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]", "name": "userRewardsInformation", "type": "tuple[]" }], "internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData", "name": "sTokenIncentivesUserData", "type": "tuple" }], "internalType": "struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }],
152
152
  "networks": {
153
+ "1": {
154
+ "address": "0x162A7AC02f547ad796CA549f757e2b8d1D9b10a6"
155
+ },
153
156
  "10": {
154
- "address": "0x6dD4b295B457A26CC2646aAf2519436681afb5d4"
157
+ "address": "0x6F143FE2F7B02424ad3CaD1593D6f36c0Aab69d7"
158
+ },
159
+ "8453": {
160
+ "address": "0xEdD3b4737C1a0011626631a977b91Cf3E944982d"
161
+ },
162
+ "42161": {
163
+ "address": "0xDA67AF3403555Ce0AE3ffC22fDb7354458277358"
155
164
  }
156
165
  }
157
166
  },
@@ -236,6 +245,9 @@ module.exports = {
236
245
  "1": {
237
246
  "address": "0xc3d688B66703497DAA19211EEdff47f25384cdc3"
238
247
  },
248
+ "8453": {
249
+ "address": "0xb125E6687d4313864e53df431d5425969c15Eb2F"
250
+ },
239
251
  "42161": {
240
252
  "address": "0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf"
241
253
  }
@@ -289,7 +301,7 @@ module.exports = {
289
301
  }
290
302
  }
291
303
  },
292
- "CompV3USDCBulker": {
304
+ "CompV3BulkerMainnetUSDC": {
293
305
  "abi": [{ "inputs": [{ "internalType": "address", "name": "admin_", "type": "address" }, { "internalType": "address payable", "name": "weth_", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "FailedToSendEther", "type": "error" }, { "inputs": [], "name": "InvalidArgument", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "inputs": [], "name": "ACTION_CLAIM_REWARD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_ASSET", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_ETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_TRANSFER_ASSET", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_ASSET", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_ETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "actions", "type": "uint256[]" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" }], "name": "invoke", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }], "name": "sweepEth", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "contract ERC20", "name": "asset", "type": "address" }], "name": "sweepToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "weth", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" }],
294
306
  "networks": {
295
307
  "1": {
@@ -297,28 +309,20 @@ module.exports = {
297
309
  }
298
310
  }
299
311
  },
300
- "CompV3USDbCBulker": {
301
- "abi": [{ "inputs": [{ "internalType": "address", "name": "admin_", "type": "address" }, { "internalType": "address payable", "name": "wrappedNativeToken_", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "FailedToSendNativeToken", "type": "error" }, { "inputs": [], "name": "InvalidAddress", "type": "error" }, { "inputs": [], "name": "InvalidArgument", "type": "error" }, { "inputs": [], "name": "TransferInFailed", "type": "error" }, { "inputs": [], "name": "TransferOutFailed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "inputs": [], "name": "UnhandledAction", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldAdmin", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "AdminTransferred", "type": "event" }, { "inputs": [], "name": "ACTION_CLAIM_REWARD", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_TRANSFER_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32[]", "name": "actions", "type": "bytes32[]" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" }], "name": "invoke", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }], "name": "sweepNativeToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }], "name": "sweepToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "transferAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "wrappedNativeToken", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" }],
302
- "networks": {
303
- "8453": {
304
- "address": "0x78D0677032A35c63D142a48A2037048871212a8C"
305
- }
306
- }
307
- },
308
- "CompV3ETHBulker": {
312
+ "CompV3BulkerMainnetETH": {
309
313
  "abi": [{ "inputs": [{ "internalType": "address", "name": "admin_", "type": "address" }, { "internalType": "address payable", "name": "weth_", "type": "address" }, { "internalType": "address", "name": "wsteth_", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "FailedToSendNativeToken", "type": "error" }, { "inputs": [], "name": "InvalidAddress", "type": "error" }, { "inputs": [], "name": "InvalidArgument", "type": "error" }, { "inputs": [], "name": "TransferInFailed", "type": "error" }, { "inputs": [], "name": "TransferOutFailed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "inputs": [], "name": "UnhandledAction", "type": "error" }, { "inputs": [], "name": "UnsupportedBaseAsset", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldAdmin", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "AdminTransferred", "type": "event" }, { "inputs": [], "name": "ACTION_CLAIM_REWARD", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_STETH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_TRANSFER_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_STETH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32[]", "name": "actions", "type": "bytes32[]" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" }], "name": "invoke", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "steth", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }], "name": "sweepNativeToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }], "name": "sweepToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "transferAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "wrappedNativeToken", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "wsteth", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" }],
310
314
  "networks": {
311
315
  "1": {
312
316
  "address": "0xa397a8C2086C554B531c02E29f3291c9704B00c7"
313
- },
314
- "8453": {
315
- "address": "0x78D0677032A35c63D142a48A2037048871212a8C"
316
317
  }
317
318
  }
318
319
  },
319
- "CompV3USDCBulkerArb": {
320
+ "CompV3BulkerL2": {
320
321
  "abi": [{ "inputs": [{ "internalType": "address", "name": "admin_", "type": "address" }, { "internalType": "address payable", "name": "wrappedNativeToken_", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "FailedToSendNativeToken", "type": "error" }, { "inputs": [], "name": "InvalidAddress", "type": "error" }, { "inputs": [], "name": "InvalidArgument", "type": "error" }, { "inputs": [], "name": "TransferInFailed", "type": "error" }, { "inputs": [], "name": "TransferOutFailed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "inputs": [], "name": "UnhandledAction", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldAdmin", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "AdminTransferred", "type": "event" }, { "inputs": [], "name": "ACTION_CLAIM_REWARD", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_SUPPLY_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_TRANSFER_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_ASSET", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ACTION_WITHDRAW_NATIVE_TOKEN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32[]", "name": "actions", "type": "bytes32[]" }, { "internalType": "bytes[]", "name": "data", "type": "bytes[]" }], "name": "invoke", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }], "name": "sweepNativeToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }], "name": "sweepToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "transferAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "wrappedNativeToken", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" }],
321
322
  "networks": {
323
+ "8453": {
324
+ "address": "0x78D0677032A35c63D142a48A2037048871212a8C"
325
+ },
322
326
  "42161": {
323
327
  "address": "0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"
324
328
  }
@@ -59,7 +59,6 @@ export const getLlamaLendGlobalData = (web3, network, selectedMarket) => __await
59
59
  const FeedRegistryAbi = getConfigContractAbi('FeedRegistry');
60
60
  const collAsset = selectedMarket.collAsset;
61
61
  const debtAsset = selectedMarket.baseAsset;
62
- console.log(selectedMarket.controllerAddress);
63
62
  // if something else is needed
64
63
  const multicallData = [
65
64
  {
@@ -74,10 +73,8 @@ export const getLlamaLendGlobalData = (web3, network, selectedMarket) => __await
74
73
  },
75
74
  ];
76
75
  const multiRes = yield multicall(multicallData, web3, network);
77
- console.log(multiRes);
78
76
  const data = multiRes[1][0];
79
77
  const debtUsdPrice = getEthAmountForDecimals(multiRes[0][0], 8);
80
- console.log('here');
81
78
  // all prices are in 18 decimals
82
79
  const totalDebt = assetAmountInEth(data.totalDebt, debtAsset);
83
80
  const totalDebtSupplied = assetAmountInEth(data.debtTokenTotalSupply, debtAsset);
@@ -27,9 +27,9 @@ const BULKER_OPTIONS = {
27
27
  [NetworkNumber.Base]: {
28
28
  [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
29
29
  [CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
30
+ [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
30
31
  // Non-existing markets, keeping it because of typescript
31
32
  [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
32
- [CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
33
33
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
34
34
  },
35
35
  [NetworkNumber.Opt]: {
@@ -56,7 +56,7 @@ export const COMPOUND_V2 = {
56
56
  // icon: SvgAdapter(protocolIcons.compound),
57
57
  };
58
58
  export const COMPOUND_V3_USDC = (networkId) => ({
59
- chainIds: [NetworkNumber.Eth, NetworkNumber.Arb],
59
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base],
60
60
  label: 'Compound V3 - USDC',
61
61
  shortLabel: 'v3',
62
62
  value: CompoundVersions.CompoundV3USDC,
@@ -65,8 +65,8 @@ export const COMPOUND_V3_USDC = (networkId) => ({
65
65
  baseMarket: 'cUSDCv3',
66
66
  baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
67
67
  secondLabel: 'Market',
68
- bulkerName: networkId === NetworkNumber.Arb ? 'CompV3USDCBulkerArb' : 'CompV3USDCBulker',
69
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Arb ? 'CompV3USDCBulkerArb' : 'CompV3USDCBulker', networkId),
68
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
69
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
70
70
  bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
71
71
  // icon: SvgAdapter(protocolIcons.compoundv3),
72
72
  });
@@ -80,8 +80,8 @@ export const COMPOUND_V3_USDCe = (networkId) => ({
80
80
  baseMarket: 'cUSDCev3',
81
81
  baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
82
82
  secondLabel: 'Market',
83
- bulkerName: 'CompV3USDCBulkerArb',
84
- bulkerAddress: getConfigContractAddress('CompV3USDCBulkerArb', networkId),
83
+ bulkerName: 'CompV3BulkerL2',
84
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
85
85
  bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
86
86
  // icon: SvgAdapter(protocolIcons.compoundv3),
87
87
  });
@@ -95,8 +95,8 @@ export const COMPOUND_V3_ETH = (networkId) => ({
95
95
  baseMarket: 'cETHv3',
96
96
  baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
97
97
  secondLabel: 'Market',
98
- bulkerName: 'CompV3ETHBulker',
99
- bulkerAddress: getConfigContractAddress('CompV3ETHBulker', networkId),
98
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
99
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
100
100
  bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
101
101
  // icon: SvgAdapter(protocolIcons.compoundv3),
102
102
  });
@@ -110,8 +110,8 @@ export const COMPOUND_V3_USDBC = (networkId) => ({
110
110
  baseMarket: 'cUSDbCv3',
111
111
  baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
112
112
  secondLabel: 'Market',
113
- bulkerName: 'CompV3USDbCBulker',
114
- bulkerAddress: getConfigContractAddress('CompV3USDbCBulker', networkId),
113
+ bulkerName: 'CompV3BulkerL2',
114
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
115
115
  bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
116
116
  // icon: SvgAdapter(protocolIcons.compoundv3),
117
117
  });
@@ -1,11 +1,12 @@
1
1
  export declare const compoundV2CollateralAssets: import("@defisaver/tokens/esm/types").AssetData[];
2
2
  export declare const v3USDCCollAssetsEth: string[];
3
3
  export declare const v3USDCCollAssetsArb: string[];
4
+ export declare const v3USDCCollAssetsBase: string[];
4
5
  export declare const v3USDCCollAssets: {
5
6
  readonly 1: string[];
6
7
  readonly 10: readonly [];
7
8
  readonly 42161: string[];
8
- readonly 8453: readonly [];
9
+ readonly 8453: string[];
9
10
  };
10
11
  export declare const v3USDCeCollAssetsArb: string[];
11
12
  export declare const v3USDCeCollAssets: {
@@ -6,12 +6,13 @@ export const compoundV2CollateralAssets = [
6
6
  ].map((symbol) => getAssetInfo(symbol));
7
7
  export const v3USDCCollAssetsEth = ['ETH', 'COMP', 'WBTC', 'UNI', 'LINK'];
8
8
  export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
9
+ export const v3USDCCollAssetsBase = ['ETH', 'cbETH'];
9
10
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
10
11
  export const v3USDCCollAssets = {
11
12
  [NetworkNumber.Eth]: v3USDCCollAssetsEth,
12
13
  [NetworkNumber.Opt]: [],
13
14
  [NetworkNumber.Arb]: v3USDCCollAssetsArb,
14
- [NetworkNumber.Base]: [],
15
+ [NetworkNumber.Base]: v3USDCCollAssetsBase,
15
16
  };
16
17
  export const v3USDCeCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
17
18
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
@@ -14,9 +14,9 @@ export type AdminTransferred = ContractEventLog<{
14
14
  0: string;
15
15
  1: string;
16
16
  }>;
17
- export interface CompV3USDbCBulker extends BaseContract {
18
- constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3USDbCBulker;
19
- clone(): CompV3USDbCBulker;
17
+ export interface CompV3BulkerL2 extends BaseContract {
18
+ constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3BulkerL2;
19
+ clone(): CompV3BulkerL2;
20
20
  methods: {
21
21
  ACTION_CLAIM_REWARD(): NonPayableTransactionObject<string>;
22
22
  ACTION_SUPPLY_ASSET(): NonPayableTransactionObject<string>;
@@ -14,9 +14,9 @@ export type AdminTransferred = ContractEventLog<{
14
14
  0: string;
15
15
  1: string;
16
16
  }>;
17
- export interface CompV3ETHBulker extends BaseContract {
18
- constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3ETHBulker;
19
- clone(): CompV3ETHBulker;
17
+ export interface CompV3BulkerMainnetETH extends BaseContract {
18
+ constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3BulkerMainnetETH;
19
+ clone(): CompV3BulkerMainnetETH;
20
20
  methods: {
21
21
  ACTION_CLAIM_REWARD(): NonPayableTransactionObject<string>;
22
22
  ACTION_SUPPLY_ASSET(): NonPayableTransactionObject<string>;
@@ -9,9 +9,9 @@ export interface EventOptions {
9
9
  fromBlock?: BlockType;
10
10
  topics?: string[];
11
11
  }
12
- export interface CompV3USDCBulker extends BaseContract {
13
- constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3USDCBulker;
14
- clone(): CompV3USDCBulker;
12
+ export interface CompV3BulkerMainnetUSDC extends BaseContract {
13
+ constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CompV3BulkerMainnetUSDC;
14
+ clone(): CompV3BulkerMainnetUSDC;
15
15
  methods: {
16
16
  ACTION_CLAIM_REWARD(): NonPayableTransactionObject<string>;
17
17
  ACTION_SUPPLY_ASSET(): NonPayableTransactionObject<string>;
@@ -12,10 +12,9 @@ export type { CbEth } from "./CbEth";
12
12
  export type { ChickenBondsManager } from "./ChickenBondsManager";
13
13
  export type { ChickenBondsView } from "./ChickenBondsView";
14
14
  export type { CollSurplusPool } from "./CollSurplusPool";
15
- export type { CompV3ETHBulker } from "./CompV3ETHBulker";
16
- export type { CompV3USDCBulker } from "./CompV3USDCBulker";
17
- export type { CompV3USDCBulkerArb } from "./CompV3USDCBulkerArb";
18
- export type { CompV3USDbCBulker } from "./CompV3USDbCBulker";
15
+ export type { CompV3BulkerL2 } from "./CompV3BulkerL2";
16
+ export type { CompV3BulkerMainnetETH } from "./CompV3BulkerMainnetETH";
17
+ export type { CompV3BulkerMainnetUSDC } from "./CompV3BulkerMainnetUSDC";
19
18
  export type { CompV3View } from "./CompV3View";
20
19
  export type { CompoundLoanInfo } from "./CompoundLoanInfo";
21
20
  export type { Comptroller } from "./Comptroller";
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@defisaver/positions-sdk",
3
- "version": "0.0.59",
4
- "description": "",
5
- "main": "./cjs/index.js",
6
- "module": "./esm/index.js",
7
- "types": "./esm/index.d.ts",
8
- "scripts": {
9
- "build:esm": "rm -rf esm && tsc -p tsconfig.json",
10
- "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
- "build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
- "dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
13
- "lint": "eslint src/ --fix",
14
- "generate-contracts": "node scripts/generateContracts.js",
15
- "test": "mocha tests/*",
16
- "build-test": "npm run build && mocha tests/*"
17
- },
18
- "keywords": [],
19
- "author": "",
20
- "license": "ISC",
21
- "dependencies": {
22
- "@defisaver/tokens": "^1.5.9",
23
- "@ethersproject/bignumber": "^5.7.0",
24
- "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
25
- "decimal.js": "^10.4.3"
26
- },
27
- "devDependencies": {
28
- "@defisaver/eslint-config": "^1.0.1",
29
- "chai": "^4.3.8",
30
- "dotenv": "^16.3.1",
31
- "eslint": "^8.49.0",
32
- "mocha": "^10.2.0",
33
- "typechain": "^8.3.1",
34
- "typechain-target-web3-v1-3mihai3": "^6.0.2",
35
- "typescript": "^5.2.2"
36
- },
37
- "peerDependencies": {
38
- "web3": "^1.10.2"
39
- }
40
- }
1
+ {
2
+ "name": "@defisaver/positions-sdk",
3
+ "version": "0.0.61",
4
+ "description": "",
5
+ "main": "./cjs/index.js",
6
+ "module": "./esm/index.js",
7
+ "types": "./esm/index.d.ts",
8
+ "scripts": {
9
+ "build:esm": "rm -rf esm && tsc -p tsconfig.json",
10
+ "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
+ "build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
+ "dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
13
+ "lint": "eslint src/ --fix",
14
+ "generate-contracts": "node scripts/generateContracts.js",
15
+ "test": "mocha tests/*",
16
+ "build-test": "npm run build && mocha tests/*"
17
+ },
18
+ "keywords": [],
19
+ "author": "",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@defisaver/tokens": "^1.5.9",
23
+ "@ethersproject/bignumber": "^5.7.0",
24
+ "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
25
+ "decimal.js": "^10.4.3"
26
+ },
27
+ "devDependencies": {
28
+ "@defisaver/eslint-config": "^1.0.1",
29
+ "chai": "^4.3.8",
30
+ "dotenv": "^16.3.1",
31
+ "eslint": "^8.49.0",
32
+ "mocha": "^10.2.0",
33
+ "typechain": "^8.3.1",
34
+ "typechain-target-web3-v1-3mihai3": "^6.0.2",
35
+ "typescript": "^5.2.2"
36
+ },
37
+ "peerDependencies": {
38
+ "web3": "^1.10.2"
39
+ }
40
+ }