@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.
- package/README.md +63 -63
- package/cjs/aaveV3/index.js +2 -1
- package/cjs/config/contracts.d.ts +225 -282
- package/cjs/config/contracts.js +19 -15
- package/cjs/llamaLend/index.js +0 -3
- package/cjs/markets/compound/index.js +10 -10
- package/cjs/markets/compound/marketsAssets.d.ts +2 -1
- package/cjs/markets/compound/marketsAssets.js +3 -2
- package/{esm/types/contracts/generated/CompV3USDbCBulker.d.ts → cjs/types/contracts/generated/CompV3BulkerL2.d.ts} +3 -3
- package/cjs/types/contracts/generated/{CompV3ETHBulker.d.ts → CompV3BulkerMainnetETH.d.ts} +3 -3
- package/{esm/types/contracts/generated/CompV3USDCBulker.d.ts → cjs/types/contracts/generated/CompV3BulkerMainnetUSDC.d.ts} +3 -3
- package/cjs/types/contracts/generated/index.d.ts +3 -4
- package/esm/aaveV3/index.js +2 -1
- package/esm/config/contracts.d.ts +225 -282
- package/esm/config/contracts.js +19 -15
- package/esm/llamaLend/index.js +0 -3
- package/esm/markets/compound/index.js +10 -10
- package/esm/markets/compound/marketsAssets.d.ts +2 -1
- package/esm/markets/compound/marketsAssets.js +2 -1
- package/{cjs/types/contracts/generated/CompV3USDbCBulker.d.ts → esm/types/contracts/generated/CompV3BulkerL2.d.ts} +3 -3
- package/esm/types/contracts/generated/{CompV3ETHBulker.d.ts → CompV3BulkerMainnetETH.d.ts} +3 -3
- package/{cjs/types/contracts/generated/CompV3USDCBulker.d.ts → esm/types/contracts/generated/CompV3BulkerMainnetUSDC.d.ts} +3 -3
- package/esm/types/contracts/generated/index.d.ts +3 -4
- package/package.json +40 -40
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +562 -561
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +273 -273
- package/src/config/contracts.js +855 -851
- package/src/constants/index.ts +5 -5
- package/src/contracts.ts +126 -126
- package/src/curveUsd/index.ts +229 -229
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/index.ts +7 -7
- package/src/helpers/llamaLendHelpers/index.ts +45 -45
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +56 -56
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +46 -46
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +276 -279
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +24 -24
- package/src/markets/compound/index.ts +141 -141
- package/src/markets/compound/marketsAssets.ts +49 -48
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +5 -5
- package/src/markets/llamaLend/index.ts +65 -65
- package/src/markets/morphoBlue/index.ts +262 -262
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +75 -75
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +619 -619
- package/src/morphoBlue/index.ts +177 -177
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +51 -51
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +422 -422
- package/src/staking/staking.ts +174 -174
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +83 -83
- package/src/types/compound.ts +128 -128
- package/src/types/contracts/generated/{CompV3USDbCBulker.ts → CompV3BulkerL2.ts} +3 -3
- package/src/types/contracts/generated/{CompV3ETHBulker.ts → CompV3BulkerMainnetETH.ts} +3 -3
- package/src/types/contracts/generated/{CompV3USDCBulker.ts → CompV3BulkerMainnetUSDC.ts} +3 -3
- package/src/types/contracts/generated/index.ts +3 -4
- package/src/types/curveUsd.ts +118 -118
- package/src/types/index.ts +8 -8
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +119 -119
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +107 -107
- package/src/types/spark.ts +106 -106
- package/yarn-error.log +64 -0
- package/cjs/types/contracts/generated/CompV3USDCBulkerArb.d.ts +0 -41
- package/cjs/types/contracts/generated/CompV3USDbCBulker.js +0 -5
- package/esm/types/contracts/generated/CompV3USDCBulkerArb.d.ts +0 -41
- package/esm/types/contracts/generated/CompV3USDbCBulker.js +0 -4
- package/src/types/contracts/generated/CompV3USDCBulkerArb.ts +0 -85
- /package/cjs/types/contracts/generated/{CompV3ETHBulker.js → CompV3BulkerL2.js} +0 -0
- /package/cjs/types/contracts/generated/{CompV3USDCBulker.js → CompV3BulkerMainnetETH.js} +0 -0
- /package/cjs/types/contracts/generated/{CompV3USDCBulkerArb.js → CompV3BulkerMainnetUSDC.js} +0 -0
- /package/esm/types/contracts/generated/{CompV3ETHBulker.js → CompV3BulkerL2.js} +0 -0
- /package/esm/types/contracts/generated/{CompV3USDCBulker.js → CompV3BulkerMainnetETH.js} +0 -0
- /package/esm/types/contracts/generated/{CompV3USDCBulkerArb.js → CompV3BulkerMainnetUSDC.js} +0 -0
package/cjs/config/contracts.js
CHANGED
|
@@ -151,8 +151,17 @@ module.exports = {
|
|
|
151
151
|
"AaveUiIncentiveDataProviderV3": {
|
|
152
152
|
"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" }],
|
|
153
153
|
"networks": {
|
|
154
|
+
"1": {
|
|
155
|
+
"address": "0x162A7AC02f547ad796CA549f757e2b8d1D9b10a6"
|
|
156
|
+
},
|
|
154
157
|
"10": {
|
|
155
|
-
"address": "
|
|
158
|
+
"address": "0x6F143FE2F7B02424ad3CaD1593D6f36c0Aab69d7"
|
|
159
|
+
},
|
|
160
|
+
"8453": {
|
|
161
|
+
"address": "0xEdD3b4737C1a0011626631a977b91Cf3E944982d"
|
|
162
|
+
},
|
|
163
|
+
"42161": {
|
|
164
|
+
"address": "0xDA67AF3403555Ce0AE3ffC22fDb7354458277358"
|
|
156
165
|
}
|
|
157
166
|
}
|
|
158
167
|
},
|
|
@@ -237,6 +246,9 @@ module.exports = {
|
|
|
237
246
|
"1": {
|
|
238
247
|
"address": "0xc3d688B66703497DAA19211EEdff47f25384cdc3"
|
|
239
248
|
},
|
|
249
|
+
"8453": {
|
|
250
|
+
"address": "0xb125E6687d4313864e53df431d5425969c15Eb2F"
|
|
251
|
+
},
|
|
240
252
|
"42161": {
|
|
241
253
|
"address": "0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf"
|
|
242
254
|
}
|
|
@@ -290,7 +302,7 @@ module.exports = {
|
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
304
|
},
|
|
293
|
-
"
|
|
305
|
+
"CompV3BulkerMainnetUSDC": {
|
|
294
306
|
"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" }],
|
|
295
307
|
"networks": {
|
|
296
308
|
"1": {
|
|
@@ -298,28 +310,20 @@ module.exports = {
|
|
|
298
310
|
}
|
|
299
311
|
}
|
|
300
312
|
},
|
|
301
|
-
"
|
|
302
|
-
"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" }],
|
|
303
|
-
"networks": {
|
|
304
|
-
"8453": {
|
|
305
|
-
"address": "0x78D0677032A35c63D142a48A2037048871212a8C"
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
"CompV3ETHBulker": {
|
|
313
|
+
"CompV3BulkerMainnetETH": {
|
|
310
314
|
"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" }],
|
|
311
315
|
"networks": {
|
|
312
316
|
"1": {
|
|
313
317
|
"address": "0xa397a8C2086C554B531c02E29f3291c9704B00c7"
|
|
314
|
-
},
|
|
315
|
-
"8453": {
|
|
316
|
-
"address": "0x78D0677032A35c63D142a48A2037048871212a8C"
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
},
|
|
320
|
-
"
|
|
321
|
+
"CompV3BulkerL2": {
|
|
321
322
|
"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" }],
|
|
322
323
|
"networks": {
|
|
324
|
+
"8453": {
|
|
325
|
+
"address": "0x78D0677032A35c63D142a48A2037048871212a8C"
|
|
326
|
+
},
|
|
323
327
|
"42161": {
|
|
324
328
|
"address": "0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"
|
|
325
329
|
}
|
package/cjs/llamaLend/index.js
CHANGED
|
@@ -65,7 +65,6 @@ const getLlamaLendGlobalData = (web3, network, selectedMarket) => __awaiter(void
|
|
|
65
65
|
const FeedRegistryAbi = (0, contracts_1.getConfigContractAbi)('FeedRegistry');
|
|
66
66
|
const collAsset = selectedMarket.collAsset;
|
|
67
67
|
const debtAsset = selectedMarket.baseAsset;
|
|
68
|
-
console.log(selectedMarket.controllerAddress);
|
|
69
68
|
// if something else is needed
|
|
70
69
|
const multicallData = [
|
|
71
70
|
{
|
|
@@ -80,10 +79,8 @@ const getLlamaLendGlobalData = (web3, network, selectedMarket) => __awaiter(void
|
|
|
80
79
|
},
|
|
81
80
|
];
|
|
82
81
|
const multiRes = yield (0, multicall_1.multicall)(multicallData, web3, network);
|
|
83
|
-
console.log(multiRes);
|
|
84
82
|
const data = multiRes[1][0];
|
|
85
83
|
const debtUsdPrice = (0, utils_1.getEthAmountForDecimals)(multiRes[0][0], 8);
|
|
86
|
-
console.log('here');
|
|
87
84
|
// all prices are in 18 decimals
|
|
88
85
|
const totalDebt = (0, tokens_1.assetAmountInEth)(data.totalDebt, debtAsset);
|
|
89
86
|
const totalDebtSupplied = (0, tokens_1.assetAmountInEth)(data.debtTokenTotalSupply, debtAsset);
|
|
@@ -30,9 +30,9 @@ const BULKER_OPTIONS = {
|
|
|
30
30
|
[common_1.NetworkNumber.Base]: {
|
|
31
31
|
[types_1.CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
32
32
|
[types_1.CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
|
|
33
|
+
[types_1.CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
33
34
|
// Non-existing markets, keeping it because of typescript
|
|
34
35
|
[types_1.CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
35
|
-
[types_1.CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
|
|
36
36
|
[types_1.CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
37
37
|
},
|
|
38
38
|
[common_1.NetworkNumber.Opt]: {
|
|
@@ -59,7 +59,7 @@ exports.COMPOUND_V2 = {
|
|
|
59
59
|
// icon: SvgAdapter(protocolIcons.compound),
|
|
60
60
|
};
|
|
61
61
|
const COMPOUND_V3_USDC = (networkId) => ({
|
|
62
|
-
chainIds: [common_1.NetworkNumber.Eth, common_1.NetworkNumber.Arb],
|
|
62
|
+
chainIds: [common_1.NetworkNumber.Eth, common_1.NetworkNumber.Arb, common_1.NetworkNumber.Base],
|
|
63
63
|
label: 'Compound V3 - USDC',
|
|
64
64
|
shortLabel: 'v3',
|
|
65
65
|
value: types_1.CompoundVersions.CompoundV3USDC,
|
|
@@ -68,8 +68,8 @@ const COMPOUND_V3_USDC = (networkId) => ({
|
|
|
68
68
|
baseMarket: 'cUSDCv3',
|
|
69
69
|
baseMarketAddress: (0, contracts_1.getConfigContractAddress)('cUSDCv3', networkId),
|
|
70
70
|
secondLabel: 'Market',
|
|
71
|
-
bulkerName: networkId === common_1.NetworkNumber.
|
|
72
|
-
bulkerAddress: (0, contracts_1.getConfigContractAddress)(networkId === common_1.NetworkNumber.
|
|
71
|
+
bulkerName: networkId === common_1.NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
|
|
72
|
+
bulkerAddress: (0, contracts_1.getConfigContractAddress)(networkId === common_1.NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
|
|
73
73
|
bulkerOptions: BULKER_OPTIONS[networkId][types_1.CompoundVersions.CompoundV3USDC],
|
|
74
74
|
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
75
75
|
});
|
|
@@ -84,8 +84,8 @@ const COMPOUND_V3_USDCe = (networkId) => ({
|
|
|
84
84
|
baseMarket: 'cUSDCev3',
|
|
85
85
|
baseMarketAddress: (0, contracts_1.getConfigContractAddress)('cUSDCev3', networkId),
|
|
86
86
|
secondLabel: 'Market',
|
|
87
|
-
bulkerName: '
|
|
88
|
-
bulkerAddress: (0, contracts_1.getConfigContractAddress)('
|
|
87
|
+
bulkerName: 'CompV3BulkerL2',
|
|
88
|
+
bulkerAddress: (0, contracts_1.getConfigContractAddress)('CompV3BulkerL2', networkId),
|
|
89
89
|
bulkerOptions: BULKER_OPTIONS[networkId][types_1.CompoundVersions.CompoundV3USDCe],
|
|
90
90
|
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
91
91
|
});
|
|
@@ -100,8 +100,8 @@ const COMPOUND_V3_ETH = (networkId) => ({
|
|
|
100
100
|
baseMarket: 'cETHv3',
|
|
101
101
|
baseMarketAddress: (0, contracts_1.getConfigContractAddress)('cETHv3', networkId),
|
|
102
102
|
secondLabel: 'Market',
|
|
103
|
-
bulkerName: '
|
|
104
|
-
bulkerAddress: (0, contracts_1.getConfigContractAddress)('
|
|
103
|
+
bulkerName: networkId === common_1.NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
104
|
+
bulkerAddress: (0, contracts_1.getConfigContractAddress)(networkId === common_1.NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
105
105
|
bulkerOptions: BULKER_OPTIONS[networkId][types_1.CompoundVersions.CompoundV3ETH],
|
|
106
106
|
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
107
107
|
});
|
|
@@ -116,8 +116,8 @@ const COMPOUND_V3_USDBC = (networkId) => ({
|
|
|
116
116
|
baseMarket: 'cUSDbCv3',
|
|
117
117
|
baseMarketAddress: (0, contracts_1.getConfigContractAddress)('cUSDbCv3', networkId),
|
|
118
118
|
secondLabel: 'Market',
|
|
119
|
-
bulkerName: '
|
|
120
|
-
bulkerAddress: (0, contracts_1.getConfigContractAddress)('
|
|
119
|
+
bulkerName: 'CompV3BulkerL2',
|
|
120
|
+
bulkerAddress: (0, contracts_1.getConfigContractAddress)('CompV3BulkerL2', networkId),
|
|
121
121
|
bulkerOptions: BULKER_OPTIONS[networkId][types_1.CompoundVersions.CompoundV3USDbC],
|
|
122
122
|
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
123
123
|
});
|
|
@@ -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:
|
|
9
|
+
readonly 8453: string[];
|
|
9
10
|
};
|
|
10
11
|
export declare const v3USDCeCollAssetsArb: string[];
|
|
11
12
|
export declare const v3USDCeCollAssets: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.v3USDbCCollAssets = exports.v3USDbCCollAssetsBase = exports.v3ETHCollAssets = exports.v3ETHCollAssetsBase = exports.v3ETHCollAssetsEth = exports.v3USDCeCollAssets = exports.v3USDCeCollAssetsArb = exports.v3USDCCollAssets = exports.v3USDCCollAssetsArb = exports.v3USDCCollAssetsEth = exports.compoundV2CollateralAssets = void 0;
|
|
3
|
+
exports.v3USDbCCollAssets = exports.v3USDbCCollAssetsBase = exports.v3ETHCollAssets = exports.v3ETHCollAssetsBase = exports.v3ETHCollAssetsEth = exports.v3USDCeCollAssets = exports.v3USDCeCollAssetsArb = exports.v3USDCCollAssets = exports.v3USDCCollAssetsBase = exports.v3USDCCollAssetsArb = exports.v3USDCCollAssetsEth = exports.compoundV2CollateralAssets = void 0;
|
|
4
4
|
const tokens_1 = require("@defisaver/tokens");
|
|
5
5
|
const common_1 = require("../../types/common");
|
|
6
6
|
exports.compoundV2CollateralAssets = [
|
|
@@ -9,12 +9,13 @@ exports.compoundV2CollateralAssets = [
|
|
|
9
9
|
].map((symbol) => (0, tokens_1.getAssetInfo)(symbol));
|
|
10
10
|
exports.v3USDCCollAssetsEth = ['ETH', 'COMP', 'WBTC', 'UNI', 'LINK'];
|
|
11
11
|
exports.v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
|
|
12
|
+
exports.v3USDCCollAssetsBase = ['ETH', 'cbETH'];
|
|
12
13
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
13
14
|
exports.v3USDCCollAssets = {
|
|
14
15
|
[common_1.NetworkNumber.Eth]: exports.v3USDCCollAssetsEth,
|
|
15
16
|
[common_1.NetworkNumber.Opt]: [],
|
|
16
17
|
[common_1.NetworkNumber.Arb]: exports.v3USDCCollAssetsArb,
|
|
17
|
-
[common_1.NetworkNumber.Base]:
|
|
18
|
+
[common_1.NetworkNumber.Base]: exports.v3USDCCollAssetsBase,
|
|
18
19
|
};
|
|
19
20
|
exports.v3USDCeCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
|
|
20
21
|
// @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
|
|
18
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions):
|
|
19
|
-
clone():
|
|
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
|
|
18
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions):
|
|
19
|
-
clone():
|
|
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
|
|
13
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions):
|
|
14
|
-
clone():
|
|
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 {
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
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/esm/aaveV3/index.js
CHANGED
|
@@ -113,7 +113,8 @@ export function getAaveV3MarketData(web3, network, market, defaultWeb3) {
|
|
|
113
113
|
isBorrowAllowed = isLayer2Network(network) ? isBorrowAllowed : true;
|
|
114
114
|
const [{ 0: ghoDiscountedPerDiscountToken }, { 0: discountRate }, { 0: minDiscountTokenBalance }, { 0: minGhoBalanceForDiscount }, { 0: facilitatorsList },] = multiRes;
|
|
115
115
|
let rewardInfo = null;
|
|
116
|
-
|
|
116
|
+
const networksWithIncentives = [10, 42161];
|
|
117
|
+
if (networksWithIncentives.includes(network)) {
|
|
117
118
|
rewardInfo = yield aaveIncentivesContract.methods.getReservesIncentivesData(marketAddress).call();
|
|
118
119
|
rewardInfo = rewardInfo.reduce((all, _market) => {
|
|
119
120
|
// eslint-disable-next-line no-param-reassign
|