@defisaver/positions-sdk 0.0.166-dev2 → 0.0.166-dev3
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/cjs/config/contracts.js +2 -2
- package/cjs/eulerV2/index.d.ts +1 -0
- package/cjs/eulerV2/index.js +10 -3
- package/cjs/markets/euler/index.d.ts +0 -2
- package/cjs/markets/euler/index.js +1 -12
- package/cjs/types/contracts/generated/EulerV2View.d.ts +12 -0
- package/cjs/types/euler.d.ts +0 -1
- package/cjs/types/euler.js +0 -1
- package/esm/config/contracts.js +2 -2
- package/esm/eulerV2/index.d.ts +1 -0
- package/esm/eulerV2/index.js +10 -3
- package/esm/markets/euler/index.d.ts +0 -2
- package/esm/markets/euler/index.js +0 -10
- package/esm/types/contracts/generated/EulerV2View.d.ts +12 -0
- package/esm/types/euler.d.ts +0 -1
- package/esm/types/euler.js +0 -1
- package/package.json +1 -1
- package/src/config/contracts.js +2 -2
- package/src/eulerV2/index.ts +14 -3
- package/src/markets/euler/index.ts +0 -11
- package/src/types/contracts/generated/EulerV2View.ts +12 -0
- package/src/types/euler.ts +0 -1
package/cjs/config/contracts.js
CHANGED
|
@@ -1032,9 +1032,9 @@ module.exports = {
|
|
|
1032
1032
|
"networks": {}
|
|
1033
1033
|
},
|
|
1034
1034
|
"EulerV2View": {
|
|
1035
|
-
"abi": [{ "inputs": [], "name": "USD", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feedRegistry", "outputs": [{ "internalType": "contract IFeedRegistry", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "fetchUsedAccounts", "outputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address[]", "name": "accounts", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getAddrForChainlinkOracle", "outputs": [{ "internalType": "address", "name": "tokenAddrForChainlinkUsage", "type": "address" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "bool", "name": "isBorrowOperation", "type": "bool" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityRemoved", "type": "uint256" }], "internalType": "struct EulerV2View.LiquidityChangeParams[]", "name": "params", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "internalType": "uint256[]", "name": "estimatedBorrowRates", "type": "uint256[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getChainlinkPriceInETH", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInETH", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "bool", "name": "_useFallback", "type": "bool" }], "name": "getChainlinkPriceInUSD", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInUSD", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }, { "internalType": "contract IAggregatorV3", "name": "aggregator", "type": "address" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getUsersData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultCollaterals", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collateralsInfo", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_vaults", "type": "address[]" }], "name": "getVaultsInfosFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_btcPrice", "type": "int256" }], "name": "getWBtcPrice", "outputs": [{ "internalType": "int256", "name": "wBtcPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_stEthPrice", "type": "int256" }], "name": "getWStEthPrice", "outputs": [{ "internalType": "int256", "name": "wStEthPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }],
|
|
1035
|
+
"abi": [{ "inputs": [], "name": "USD", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feedRegistry", "outputs": [{ "internalType": "contract IFeedRegistry", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "fetchUsedAccounts", "outputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address[]", "name": "accounts", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getAddrForChainlinkOracle", "outputs": [{ "internalType": "address", "name": "tokenAddrForChainlinkUsage", "type": "address" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "bool", "name": "isBorrowOperation", "type": "bool" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityRemoved", "type": "uint256" }], "internalType": "struct EulerV2View.LiquidityChangeParams[]", "name": "params", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "internalType": "uint256[]", "name": "estimatedBorrowRates", "type": "uint256[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getChainlinkPriceInETH", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInETH", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "bool", "name": "_useFallback", "type": "bool" }], "name": "getChainlinkPriceInUSD", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInUSD", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }, { "internalType": "contract IAggregatorV3", "name": "aggregator", "type": "address" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getUsersData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultCollaterals", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collateralsInfo", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_vaults", "type": "address[]" }], "name": "getVaultsInfosFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_btcPrice", "type": "int256" }], "name": "getWBtcPrice", "outputs": [{ "internalType": "int256", "name": "wBtcPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_stEthPrice", "type": "int256" }], "name": "getWStEthPrice", "outputs": [{ "internalType": "int256", "name": "wStEthPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }],
|
|
1036
1036
|
"networks": {
|
|
1037
|
-
"1": { "address": "
|
|
1037
|
+
"1": { "address": "0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967" }
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
package/cjs/eulerV2/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare const EMPTY_EULER_V2_DATA: {
|
|
|
32
32
|
inPermitDisabledMode: boolean;
|
|
33
33
|
lastUpdated: number;
|
|
34
34
|
hasBorrowInDifferentVault: boolean;
|
|
35
|
+
addressSpaceTakenByAnotherAccount: boolean;
|
|
35
36
|
};
|
|
36
37
|
export declare const getEulerV2AccountData: (web3: Web3, network: NetworkNumber, address: string, extractedState: ({
|
|
37
38
|
selectedMarket: EulerV2Market;
|
package/cjs/eulerV2/index.js
CHANGED
|
@@ -46,11 +46,18 @@ const getEulerV2MarketsData = (web3, network, selectedMarket, defaultWeb3) => __
|
|
|
46
46
|
const borrowRate = (0, eulerHelpers_1.getEulerV2BorrowRate)(collateral.interestRate);
|
|
47
47
|
const utilizationRate = (0, eulerHelpers_1.getUtilizationRate)(collateral.totalBorrows, new decimal_js_1.default(collateral.totalBorrows).plus(collateral.cash).toString());
|
|
48
48
|
const supplyRate = (0, eulerHelpers_1.getEulerV2SupplyRate)(borrowRate, utilizationRate, collateral.interestFee);
|
|
49
|
+
const isEscrow = collateral.isEscrowed;
|
|
50
|
+
const isGoverned = !(0, utils_1.compareAddresses)(collateral.governorAdmin, constants_1.ZERO_ADDRESS);
|
|
51
|
+
const vaultType = isEscrow
|
|
52
|
+
? types_1.EulerV2VaultType.Escrow
|
|
53
|
+
: (isGoverned ? types_1.EulerV2VaultType.Governed : types_1.EulerV2VaultType.Ungoverned);
|
|
49
54
|
return ({
|
|
50
55
|
vaultAddress: collateral.vaultAddr,
|
|
51
56
|
assetAddress: collateral.assetAddr,
|
|
52
57
|
symbol: assetInfo.symbol,
|
|
53
58
|
vaultSymbol: collateral.vaultSymbol,
|
|
59
|
+
name: collateral.name,
|
|
60
|
+
vaultType,
|
|
54
61
|
decimals,
|
|
55
62
|
liquidationRatio: new decimal_js_1.default(collateral.liquidationLTV).div(10000).toString(),
|
|
56
63
|
collateralFactor: new decimal_js_1.default(collateral.borrowLTV).div(10000).toString(),
|
|
@@ -162,6 +169,7 @@ exports.EMPTY_EULER_V2_DATA = {
|
|
|
162
169
|
inPermitDisabledMode: false,
|
|
163
170
|
lastUpdated: Date.now(),
|
|
164
171
|
hasBorrowInDifferentVault: false,
|
|
172
|
+
addressSpaceTakenByAnotherAccount: false,
|
|
165
173
|
};
|
|
166
174
|
const getEulerV2AccountData = (web3, network, address, extractedState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
167
175
|
if (!address)
|
|
@@ -169,7 +177,6 @@ const getEulerV2AccountData = (web3, network, address, extractedState) => __awai
|
|
|
169
177
|
const { selectedMarket, assetsData, marketData, } = extractedState;
|
|
170
178
|
let payload = Object.assign(Object.assign({}, exports.EMPTY_EULER_V2_DATA), { lastUpdated: Date.now() });
|
|
171
179
|
const isInUSD = marketData.isInUSD;
|
|
172
|
-
// TODO: maybe not the best practice to get decimals from tokens package
|
|
173
180
|
const parsingDecimals = isInUSD ? 18 : (0, tokens_1.getAssetInfoByAddress)(marketData.unitOfAccount).decimals;
|
|
174
181
|
const contract = (0, contracts_1.EulerV2ViewContract)(web3, network);
|
|
175
182
|
const loanData = yield contract.methods.getUserData(address).call();
|
|
@@ -177,10 +184,10 @@ const getEulerV2AccountData = (web3, network, address, extractedState) => __awai
|
|
|
177
184
|
// there is no user position check for a specific market, only global check
|
|
178
185
|
// but we need to make sure it works for the UI and show position only for the selected market
|
|
179
186
|
if (!(0, utils_1.compareAddresses)(loanData.borrowVault, selectedMarket.marketAddress)) {
|
|
180
|
-
payload = Object.assign(Object.assign({}, payload), { borrowVault: constants_1.ZERO_ADDRESS, borrowAmountInUnit: '0', inLockDownMode: false, inPermitDisabledMode: false, hasBorrowInDifferentVault: !(0, utils_1.compareAddresses)(loanData.borrowVault, constants_1.ZERO_ADDRESS) });
|
|
187
|
+
payload = Object.assign(Object.assign({}, payload), { borrowVault: constants_1.ZERO_ADDRESS, borrowAmountInUnit: '0', inLockDownMode: false, inPermitDisabledMode: false, hasBorrowInDifferentVault: !(0, utils_1.compareAddresses)(loanData.borrowVault, constants_1.ZERO_ADDRESS), addressSpaceTakenByAnotherAccount: !(0, utils_1.compareAddresses)(loanData.owner, address) && !(0, utils_1.compareAddresses)(loanData.owner, constants_1.ZERO_ADDRESS) });
|
|
181
188
|
}
|
|
182
189
|
else {
|
|
183
|
-
payload = Object.assign(Object.assign({}, payload), { borrowVault: loanData.borrowVault, borrowAmountInUnit: loanData.borrowAmountInUnit, inLockDownMode: loanData.inLockDownMode, inPermitDisabledMode: loanData.inPermitDisabledMode,
|
|
190
|
+
payload = Object.assign(Object.assign({}, payload), { borrowVault: loanData.borrowVault, borrowAmountInUnit: loanData.borrowAmountInUnit, inLockDownMode: loanData.inLockDownMode, inPermitDisabledMode: loanData.inPermitDisabledMode, addressSpaceTakenByAnotherAccount: !(0, utils_1.compareAddresses)(loanData.owner, address) && !(0, utils_1.compareAddresses)(loanData.owner, constants_1.ZERO_ADDRESS) });
|
|
184
191
|
const borrowedInUnit = (0, utils_1.getEthAmountForDecimals)(loanData.borrowAmountInUnit, parsingDecimals);
|
|
185
192
|
const borrowedInAsset = (0, utils_1.getEthAmountForDecimals)(loanData.borrowAmountInAsset, marketData.decimals);
|
|
186
193
|
const borrowVault = loanData.borrowVault;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { NetworkNumber } from '../../types/common';
|
|
2
2
|
import { EulerV2Market } from '../../types';
|
|
3
3
|
export declare const eUSDC2: (networkId: NetworkNumber) => EulerV2Market;
|
|
4
|
-
export declare const eUSDC8: (networkId: NetworkNumber) => EulerV2Market;
|
|
5
4
|
export declare const eWETH2: (networkId: NetworkNumber) => EulerV2Market;
|
|
6
5
|
export declare const EulerV2Markets: (networkId: NetworkNumber) => {
|
|
7
6
|
readonly "eUSDC-2": EulerV2Market;
|
|
8
|
-
readonly "eUSDC-8": EulerV2Market;
|
|
9
7
|
readonly "eWETH-2": EulerV2Market;
|
|
10
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EulerV2Markets = exports.eWETH2 = exports.
|
|
3
|
+
exports.EulerV2Markets = exports.eWETH2 = exports.eUSDC2 = void 0;
|
|
4
4
|
const common_1 = require("../../types/common");
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
6
|
const eUSDC2 = (networkId) => ({
|
|
@@ -13,16 +13,6 @@ const eUSDC2 = (networkId) => ({
|
|
|
13
13
|
marketAddress: '0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9',
|
|
14
14
|
});
|
|
15
15
|
exports.eUSDC2 = eUSDC2;
|
|
16
|
-
const eUSDC8 = (networkId) => ({
|
|
17
|
-
chainIds: [common_1.NetworkNumber.Eth],
|
|
18
|
-
label: 'Stablecoin Maxi USDC',
|
|
19
|
-
shortLabel: 'eUSDC-8',
|
|
20
|
-
value: types_1.EulerV2Versions.eUSDC8,
|
|
21
|
-
asset: 'USDC',
|
|
22
|
-
secondLabel: 'Market',
|
|
23
|
-
marketAddress: '0xce45EF0414dE3516cAF1BCf937bF7F2Cf67873De',
|
|
24
|
-
});
|
|
25
|
-
exports.eUSDC8 = eUSDC8;
|
|
26
16
|
const eWETH2 = (networkId) => ({
|
|
27
17
|
chainIds: [common_1.NetworkNumber.Eth],
|
|
28
18
|
label: 'Euler Prime WETH',
|
|
@@ -35,7 +25,6 @@ const eWETH2 = (networkId) => ({
|
|
|
35
25
|
exports.eWETH2 = eWETH2;
|
|
36
26
|
const EulerV2Markets = (networkId) => ({
|
|
37
27
|
[types_1.EulerV2Versions.eUSDC2]: (0, exports.eUSDC2)(networkId),
|
|
38
|
-
[types_1.EulerV2Versions.eUSDC8]: (0, exports.eUSDC8)(networkId),
|
|
39
28
|
[types_1.EulerV2Versions.eWETH2]: (0, exports.eWETH2)(networkId),
|
|
40
29
|
});
|
|
41
30
|
exports.EulerV2Markets = EulerV2Markets;
|
|
@@ -101,6 +101,9 @@ export declare namespace EulerV2View {
|
|
|
101
101
|
string,
|
|
102
102
|
string,
|
|
103
103
|
string,
|
|
104
|
+
string,
|
|
105
|
+
string,
|
|
106
|
+
boolean,
|
|
104
107
|
number | string | BN,
|
|
105
108
|
number | string | BN,
|
|
106
109
|
number | string | BN,
|
|
@@ -118,6 +121,9 @@ export declare namespace EulerV2View {
|
|
|
118
121
|
vaultAddr: string;
|
|
119
122
|
assetAddr: string;
|
|
120
123
|
vaultSymbol: string;
|
|
124
|
+
name: string;
|
|
125
|
+
governorAdmin: string;
|
|
126
|
+
isEscrowed: boolean;
|
|
121
127
|
decimals: number | string | BN;
|
|
122
128
|
sharePriceInUnit: number | string | BN;
|
|
123
129
|
assetPriceInUnit: number | string | BN;
|
|
@@ -138,6 +144,9 @@ export declare namespace EulerV2View {
|
|
|
138
144
|
string,
|
|
139
145
|
string,
|
|
140
146
|
string,
|
|
147
|
+
boolean,
|
|
148
|
+
string,
|
|
149
|
+
string,
|
|
141
150
|
string,
|
|
142
151
|
string,
|
|
143
152
|
string,
|
|
@@ -154,6 +163,9 @@ export declare namespace EulerV2View {
|
|
|
154
163
|
vaultAddr: string;
|
|
155
164
|
assetAddr: string;
|
|
156
165
|
vaultSymbol: string;
|
|
166
|
+
name: string;
|
|
167
|
+
governorAdmin: string;
|
|
168
|
+
isEscrowed: boolean;
|
|
157
169
|
decimals: string;
|
|
158
170
|
sharePriceInUnit: string;
|
|
159
171
|
assetPriceInUnit: string;
|
package/cjs/types/euler.d.ts
CHANGED
package/cjs/types/euler.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.EulerV2VaultType = exports.EulerV2Versions = void 0;
|
|
|
4
4
|
var EulerV2Versions;
|
|
5
5
|
(function (EulerV2Versions) {
|
|
6
6
|
EulerV2Versions["eUSDC2"] = "eUSDC-2";
|
|
7
|
-
EulerV2Versions["eUSDC8"] = "eUSDC-8";
|
|
8
7
|
EulerV2Versions["eWETH2"] = "eWETH-2";
|
|
9
8
|
})(EulerV2Versions || (exports.EulerV2Versions = EulerV2Versions = {}));
|
|
10
9
|
var EulerV2VaultType;
|
package/esm/config/contracts.js
CHANGED
|
@@ -1031,9 +1031,9 @@ module.exports = {
|
|
|
1031
1031
|
"networks": {}
|
|
1032
1032
|
},
|
|
1033
1033
|
"EulerV2View": {
|
|
1034
|
-
"abi": [{ "inputs": [], "name": "USD", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feedRegistry", "outputs": [{ "internalType": "contract IFeedRegistry", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "fetchUsedAccounts", "outputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address[]", "name": "accounts", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getAddrForChainlinkOracle", "outputs": [{ "internalType": "address", "name": "tokenAddrForChainlinkUsage", "type": "address" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "bool", "name": "isBorrowOperation", "type": "bool" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityRemoved", "type": "uint256" }], "internalType": "struct EulerV2View.LiquidityChangeParams[]", "name": "params", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "internalType": "uint256[]", "name": "estimatedBorrowRates", "type": "uint256[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getChainlinkPriceInETH", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInETH", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "bool", "name": "_useFallback", "type": "bool" }], "name": "getChainlinkPriceInUSD", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInUSD", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }, { "internalType": "contract IAggregatorV3", "name": "aggregator", "type": "address" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getUsersData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultCollaterals", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collateralsInfo", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_vaults", "type": "address[]" }], "name": "getVaultsInfosFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_btcPrice", "type": "int256" }], "name": "getWBtcPrice", "outputs": [{ "internalType": "int256", "name": "wBtcPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_stEthPrice", "type": "int256" }], "name": "getWStEthPrice", "outputs": [{ "internalType": "int256", "name": "wStEthPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }],
|
|
1034
|
+
"abi": [{ "inputs": [], "name": "USD", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feedRegistry", "outputs": [{ "internalType": "contract IFeedRegistry", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_page", "type": "uint256" }, { "internalType": "uint256", "name": "_perPage", "type": "uint256" }], "name": "fetchUsedAccounts", "outputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address[]", "name": "accounts", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAaveV3TokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getAddrForChainlinkOracle", "outputs": [{ "internalType": "address", "name": "tokenAddrForChainlinkUsage", "type": "address" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "bool", "name": "isBorrowOperation", "type": "bool" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityRemoved", "type": "uint256" }], "internalType": "struct EulerV2View.LiquidityChangeParams[]", "name": "params", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "internalType": "uint256[]", "name": "estimatedBorrowRates", "type": "uint256[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getChainlinkPriceInETH", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInETH", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "bool", "name": "_useFallback", "type": "bool" }], "name": "getChainlinkPriceInUSD", "outputs": [{ "internalType": "int256", "name": "chainlinkPriceInUSD", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }], "name": "getPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }, { "internalType": "contract IAggregatorV3", "name": "aggregator", "type": "address" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_inputTokenAddr", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundInfo", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "updateTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInETH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getSparkTokenPriceInUSD", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getUsersData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "inLockDownMode", "type": "bool" }, { "internalType": "bool", "name": "inPermitDisabledMode", "type": "bool" }, { "internalType": "address", "name": "borrowVault", "type": "address" }, { "internalType": "uint256", "name": "borrowAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmountInAsset", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "collateralVault", "type": "address" }, { "internalType": "bool", "name": "usedInBorrow", "type": "bool" }, { "internalType": "uint256", "name": "collateralAmountInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInAsset", "type": "uint256" }, { "internalType": "uint256", "name": "collateralAmountInUSD", "type": "uint256" }], "internalType": "struct EulerV2View.UserCollateralInfo[]", "name": "collaterals", "type": "tuple[]" }], "internalType": "struct EulerV2View.UserData[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultCollaterals", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collateralsInfo", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_vaults", "type": "address[]" }], "name": "getVaultsInfosFull", "outputs": [{ "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "vaultAddr", "type": "address" }, { "internalType": "address", "name": "assetAddr", "type": "address" }, { "internalType": "string", "name": "vaultSymbol", "type": "string" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "bool", "name": "isEscrowed", "type": "bool" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "cash", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrows", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint16", "name": "borrowLTV", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationLTV", "type": "uint16" }, { "internalType": "uint16", "name": "initialLiquidationLTV", "type": "uint16" }, { "internalType": "uint48", "name": "targetTimestamp", "type": "uint48" }, { "internalType": "uint32", "name": "rampDuration", "type": "uint32" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }], "internalType": "struct EulerV2View.CollateralInfo[]", "name": "collaterals", "type": "tuple[]" }, { "internalType": "uint16", "name": "maxLiquidationDiscount", "type": "uint16" }, { "internalType": "uint256", "name": "liquidationCoolOffTime", "type": "uint256" }, { "internalType": "bool", "name": "badDebtSocializationEnabled", "type": "bool" }, { "internalType": "address", "name": "unitOfAccount", "type": "address" }, { "internalType": "uint256", "name": "unitOfAccountInUsd", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "assetPriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "sharePriceInUnit", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "address", "name": "irm", "type": "address" }, { "internalType": "address", "name": "balanceTrackerAddress", "type": "address" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "address", "name": "governorAdmin", "type": "address" }, { "internalType": "uint256", "name": "interestFee", "type": "uint256" }], "internalType": "struct EulerV2View.VaultInfoFull[]", "name": "data", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_btcPrice", "type": "int256" }], "name": "getWBtcPrice", "outputs": [{ "internalType": "int256", "name": "wBtcPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "int256", "name": "_stEthPrice", "type": "int256" }], "name": "getWStEthPrice", "outputs": [{ "internalType": "int256", "name": "wStEthPrice", "type": "int256" }], "stateMutability": "view", "type": "function" }],
|
|
1035
1035
|
"networks": {
|
|
1036
|
-
"1": { "address": "
|
|
1036
|
+
"1": { "address": "0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967" }
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
};
|
package/esm/eulerV2/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare const EMPTY_EULER_V2_DATA: {
|
|
|
32
32
|
inPermitDisabledMode: boolean;
|
|
33
33
|
lastUpdated: number;
|
|
34
34
|
hasBorrowInDifferentVault: boolean;
|
|
35
|
+
addressSpaceTakenByAnotherAccount: boolean;
|
|
35
36
|
};
|
|
36
37
|
export declare const getEulerV2AccountData: (web3: Web3, network: NetworkNumber, address: string, extractedState: ({
|
|
37
38
|
selectedMarket: EulerV2Market;
|
package/esm/eulerV2/index.js
CHANGED
|
@@ -40,11 +40,18 @@ export const getEulerV2MarketsData = (web3, network, selectedMarket, defaultWeb3
|
|
|
40
40
|
const borrowRate = getEulerV2BorrowRate(collateral.interestRate);
|
|
41
41
|
const utilizationRate = getUtilizationRate(collateral.totalBorrows, new Dec(collateral.totalBorrows).plus(collateral.cash).toString());
|
|
42
42
|
const supplyRate = getEulerV2SupplyRate(borrowRate, utilizationRate, collateral.interestFee);
|
|
43
|
+
const isEscrow = collateral.isEscrowed;
|
|
44
|
+
const isGoverned = !compareAddresses(collateral.governorAdmin, ZERO_ADDRESS);
|
|
45
|
+
const vaultType = isEscrow
|
|
46
|
+
? EulerV2VaultType.Escrow
|
|
47
|
+
: (isGoverned ? EulerV2VaultType.Governed : EulerV2VaultType.Ungoverned);
|
|
43
48
|
return ({
|
|
44
49
|
vaultAddress: collateral.vaultAddr,
|
|
45
50
|
assetAddress: collateral.assetAddr,
|
|
46
51
|
symbol: assetInfo.symbol,
|
|
47
52
|
vaultSymbol: collateral.vaultSymbol,
|
|
53
|
+
name: collateral.name,
|
|
54
|
+
vaultType,
|
|
48
55
|
decimals,
|
|
49
56
|
liquidationRatio: new Dec(collateral.liquidationLTV).div(10000).toString(),
|
|
50
57
|
collateralFactor: new Dec(collateral.borrowLTV).div(10000).toString(),
|
|
@@ -155,6 +162,7 @@ export const EMPTY_EULER_V2_DATA = {
|
|
|
155
162
|
inPermitDisabledMode: false,
|
|
156
163
|
lastUpdated: Date.now(),
|
|
157
164
|
hasBorrowInDifferentVault: false,
|
|
165
|
+
addressSpaceTakenByAnotherAccount: false,
|
|
158
166
|
};
|
|
159
167
|
export const getEulerV2AccountData = (web3, network, address, extractedState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
168
|
if (!address)
|
|
@@ -162,7 +170,6 @@ export const getEulerV2AccountData = (web3, network, address, extractedState) =>
|
|
|
162
170
|
const { selectedMarket, assetsData, marketData, } = extractedState;
|
|
163
171
|
let payload = Object.assign(Object.assign({}, EMPTY_EULER_V2_DATA), { lastUpdated: Date.now() });
|
|
164
172
|
const isInUSD = marketData.isInUSD;
|
|
165
|
-
// TODO: maybe not the best practice to get decimals from tokens package
|
|
166
173
|
const parsingDecimals = isInUSD ? 18 : getAssetInfoByAddress(marketData.unitOfAccount).decimals;
|
|
167
174
|
const contract = EulerV2ViewContract(web3, network);
|
|
168
175
|
const loanData = yield contract.methods.getUserData(address).call();
|
|
@@ -170,10 +177,10 @@ export const getEulerV2AccountData = (web3, network, address, extractedState) =>
|
|
|
170
177
|
// there is no user position check for a specific market, only global check
|
|
171
178
|
// but we need to make sure it works for the UI and show position only for the selected market
|
|
172
179
|
if (!compareAddresses(loanData.borrowVault, selectedMarket.marketAddress)) {
|
|
173
|
-
payload = Object.assign(Object.assign({}, payload), { borrowVault: ZERO_ADDRESS, borrowAmountInUnit: '0', inLockDownMode: false, inPermitDisabledMode: false, hasBorrowInDifferentVault: !compareAddresses(loanData.borrowVault, ZERO_ADDRESS) });
|
|
180
|
+
payload = Object.assign(Object.assign({}, payload), { borrowVault: ZERO_ADDRESS, borrowAmountInUnit: '0', inLockDownMode: false, inPermitDisabledMode: false, hasBorrowInDifferentVault: !compareAddresses(loanData.borrowVault, ZERO_ADDRESS), addressSpaceTakenByAnotherAccount: !compareAddresses(loanData.owner, address) && !compareAddresses(loanData.owner, ZERO_ADDRESS) });
|
|
174
181
|
}
|
|
175
182
|
else {
|
|
176
|
-
payload = Object.assign(Object.assign({}, payload), { borrowVault: loanData.borrowVault, borrowAmountInUnit: loanData.borrowAmountInUnit, inLockDownMode: loanData.inLockDownMode, inPermitDisabledMode: loanData.inPermitDisabledMode,
|
|
183
|
+
payload = Object.assign(Object.assign({}, payload), { borrowVault: loanData.borrowVault, borrowAmountInUnit: loanData.borrowAmountInUnit, inLockDownMode: loanData.inLockDownMode, inPermitDisabledMode: loanData.inPermitDisabledMode, addressSpaceTakenByAnotherAccount: !compareAddresses(loanData.owner, address) && !compareAddresses(loanData.owner, ZERO_ADDRESS) });
|
|
177
184
|
const borrowedInUnit = getEthAmountForDecimals(loanData.borrowAmountInUnit, parsingDecimals);
|
|
178
185
|
const borrowedInAsset = getEthAmountForDecimals(loanData.borrowAmountInAsset, marketData.decimals);
|
|
179
186
|
const borrowVault = loanData.borrowVault;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { NetworkNumber } from '../../types/common';
|
|
2
2
|
import { EulerV2Market } from '../../types';
|
|
3
3
|
export declare const eUSDC2: (networkId: NetworkNumber) => EulerV2Market;
|
|
4
|
-
export declare const eUSDC8: (networkId: NetworkNumber) => EulerV2Market;
|
|
5
4
|
export declare const eWETH2: (networkId: NetworkNumber) => EulerV2Market;
|
|
6
5
|
export declare const EulerV2Markets: (networkId: NetworkNumber) => {
|
|
7
6
|
readonly "eUSDC-2": EulerV2Market;
|
|
8
|
-
readonly "eUSDC-8": EulerV2Market;
|
|
9
7
|
readonly "eWETH-2": EulerV2Market;
|
|
10
8
|
};
|
|
@@ -9,15 +9,6 @@ export const eUSDC2 = (networkId) => ({
|
|
|
9
9
|
secondLabel: 'Market',
|
|
10
10
|
marketAddress: '0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9',
|
|
11
11
|
});
|
|
12
|
-
export const eUSDC8 = (networkId) => ({
|
|
13
|
-
chainIds: [NetworkNumber.Eth],
|
|
14
|
-
label: 'Stablecoin Maxi USDC',
|
|
15
|
-
shortLabel: 'eUSDC-8',
|
|
16
|
-
value: EulerV2Versions.eUSDC8,
|
|
17
|
-
asset: 'USDC',
|
|
18
|
-
secondLabel: 'Market',
|
|
19
|
-
marketAddress: '0xce45EF0414dE3516cAF1BCf937bF7F2Cf67873De',
|
|
20
|
-
});
|
|
21
12
|
export const eWETH2 = (networkId) => ({
|
|
22
13
|
chainIds: [NetworkNumber.Eth],
|
|
23
14
|
label: 'Euler Prime WETH',
|
|
@@ -29,6 +20,5 @@ export const eWETH2 = (networkId) => ({
|
|
|
29
20
|
});
|
|
30
21
|
export const EulerV2Markets = (networkId) => ({
|
|
31
22
|
[EulerV2Versions.eUSDC2]: eUSDC2(networkId),
|
|
32
|
-
[EulerV2Versions.eUSDC8]: eUSDC8(networkId),
|
|
33
23
|
[EulerV2Versions.eWETH2]: eWETH2(networkId),
|
|
34
24
|
});
|
|
@@ -101,6 +101,9 @@ export declare namespace EulerV2View {
|
|
|
101
101
|
string,
|
|
102
102
|
string,
|
|
103
103
|
string,
|
|
104
|
+
string,
|
|
105
|
+
string,
|
|
106
|
+
boolean,
|
|
104
107
|
number | string | BN,
|
|
105
108
|
number | string | BN,
|
|
106
109
|
number | string | BN,
|
|
@@ -118,6 +121,9 @@ export declare namespace EulerV2View {
|
|
|
118
121
|
vaultAddr: string;
|
|
119
122
|
assetAddr: string;
|
|
120
123
|
vaultSymbol: string;
|
|
124
|
+
name: string;
|
|
125
|
+
governorAdmin: string;
|
|
126
|
+
isEscrowed: boolean;
|
|
121
127
|
decimals: number | string | BN;
|
|
122
128
|
sharePriceInUnit: number | string | BN;
|
|
123
129
|
assetPriceInUnit: number | string | BN;
|
|
@@ -138,6 +144,9 @@ export declare namespace EulerV2View {
|
|
|
138
144
|
string,
|
|
139
145
|
string,
|
|
140
146
|
string,
|
|
147
|
+
boolean,
|
|
148
|
+
string,
|
|
149
|
+
string,
|
|
141
150
|
string,
|
|
142
151
|
string,
|
|
143
152
|
string,
|
|
@@ -154,6 +163,9 @@ export declare namespace EulerV2View {
|
|
|
154
163
|
vaultAddr: string;
|
|
155
164
|
assetAddr: string;
|
|
156
165
|
vaultSymbol: string;
|
|
166
|
+
name: string;
|
|
167
|
+
governorAdmin: string;
|
|
168
|
+
isEscrowed: boolean;
|
|
157
169
|
decimals: string;
|
|
158
170
|
sharePriceInUnit: string;
|
|
159
171
|
assetPriceInUnit: string;
|
package/esm/types/euler.d.ts
CHANGED
package/esm/types/euler.js
CHANGED
package/package.json
CHANGED
package/src/config/contracts.js
CHANGED
|
@@ -1032,9 +1032,9 @@ module.exports = {
|
|
|
1032
1032
|
"networks":{}
|
|
1033
1033
|
},
|
|
1034
1034
|
"EulerV2View": {
|
|
1035
|
-
"abi": [{"inputs":[],"name":"USD","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feedRegistry","outputs":[{"internalType":"contract IFeedRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_page","type":"uint256"},{"internalType":"uint256","name":"_perPage","type":"uint256"}],"name":"fetchUsedAccounts","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"accounts","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveTokenPriceInETH","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveTokenPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveV3TokenPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveV3TokenPriceInUSD","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getAddrForChainlinkOracle","outputs":[{"internalType":"address","name":"tokenAddrForChainlinkUsage","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"isBorrowOperation","type":"bool"},{"internalType":"uint256","name":"liquidityAdded","type":"uint256"},{"internalType":"uint256","name":"liquidityRemoved","type":"uint256"}],"internalType":"struct EulerV2View.LiquidityChangeParams[]","name":"params","type":"tuple[]"}],"name":"getApyAfterValuesEstimation","outputs":[{"internalType":"uint256[]","name":"estimatedBorrowRates","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getChainlinkPriceInETH","outputs":[{"internalType":"int256","name":"chainlinkPriceInETH","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"bool","name":"_useFallback","type":"bool"}],"name":"getChainlinkPriceInUSD","outputs":[{"internalType":"int256","name":"chainlinkPriceInUSD","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"uint80","name":"_roundId","type":"uint80"},{"internalType":"contract IAggregatorV3","name":"aggregator","type":"address"}],"name":"getRoundInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"updateTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"updateTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getSparkTokenPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getSparkTokenPriceInUSD","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserData","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"inLockDownMode","type":"bool"},{"internalType":"bool","name":"inPermitDisabledMode","type":"bool"},{"internalType":"address","name":"borrowVault","type":"address"},{"internalType":"uint256","name":"borrowAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"borrowAmountInAsset","type":"uint256"},{"components":[{"internalType":"address","name":"collateralVault","type":"address"},{"internalType":"bool","name":"usedInBorrow","type":"bool"},{"internalType":"uint256","name":"collateralAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInAsset","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInUSD","type":"uint256"}],"internalType":"struct EulerV2View.UserCollateralInfo[]","name":"collaterals","type":"tuple[]"}],"internalType":"struct EulerV2View.UserData","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"getUsersData","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"inLockDownMode","type":"bool"},{"internalType":"bool","name":"inPermitDisabledMode","type":"bool"},{"internalType":"address","name":"borrowVault","type":"address"},{"internalType":"uint256","name":"borrowAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"borrowAmountInAsset","type":"uint256"},{"components":[{"internalType":"address","name":"collateralVault","type":"address"},{"internalType":"bool","name":"usedInBorrow","type":"bool"},{"internalType":"uint256","name":"collateralAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInAsset","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInUSD","type":"uint256"}],"internalType":"struct EulerV2View.UserCollateralInfo[]","name":"collaterals","type":"tuple[]"}],"internalType":"struct EulerV2View.UserData[]","name":"data","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getVaultCollaterals","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collateralsInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getVaultInfoFull","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collaterals","type":"tuple[]"},{"internalType":"uint16","name":"maxLiquidationDiscount","type":"uint16"},{"internalType":"uint256","name":"liquidationCoolOffTime","type":"uint256"},{"internalType":"bool","name":"badDebtSocializationEnabled","type":"bool"},{"internalType":"address","name":"unitOfAccount","type":"address"},{"internalType":"uint256","name":"unitOfAccountInUsd","type":"uint256"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"address","name":"balanceTrackerAddress","type":"address"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"uint256","name":"interestFee","type":"uint256"}],"internalType":"struct EulerV2View.VaultInfoFull","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_vaults","type":"address[]"}],"name":"getVaultsInfosFull","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collaterals","type":"tuple[]"},{"internalType":"uint16","name":"maxLiquidationDiscount","type":"uint16"},{"internalType":"uint256","name":"liquidationCoolOffTime","type":"uint256"},{"internalType":"bool","name":"badDebtSocializationEnabled","type":"bool"},{"internalType":"address","name":"unitOfAccount","type":"address"},{"internalType":"uint256","name":"unitOfAccountInUsd","type":"uint256"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"address","name":"balanceTrackerAddress","type":"address"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"uint256","name":"interestFee","type":"uint256"}],"internalType":"struct EulerV2View.VaultInfoFull[]","name":"data","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_btcPrice","type":"int256"}],"name":"getWBtcPrice","outputs":[{"internalType":"int256","name":"wBtcPrice","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_stEthPrice","type":"int256"}],"name":"getWStEthPrice","outputs":[{"internalType":"int256","name":"wStEthPrice","type":"int256"}],"stateMutability":"view","type":"function"}],
|
|
1035
|
+
"abi": [{"inputs":[],"name":"USD","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feedRegistry","outputs":[{"internalType":"contract IFeedRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_page","type":"uint256"},{"internalType":"uint256","name":"_perPage","type":"uint256"}],"name":"fetchUsedAccounts","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"accounts","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveTokenPriceInETH","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveTokenPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveV3TokenPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getAaveV3TokenPriceInUSD","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getAddrForChainlinkOracle","outputs":[{"internalType":"address","name":"tokenAddrForChainlinkUsage","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"isBorrowOperation","type":"bool"},{"internalType":"uint256","name":"liquidityAdded","type":"uint256"},{"internalType":"uint256","name":"liquidityRemoved","type":"uint256"}],"internalType":"struct EulerV2View.LiquidityChangeParams[]","name":"params","type":"tuple[]"}],"name":"getApyAfterValuesEstimation","outputs":[{"internalType":"uint256[]","name":"estimatedBorrowRates","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getChainlinkPriceInETH","outputs":[{"internalType":"int256","name":"chainlinkPriceInETH","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"bool","name":"_useFallback","type":"bool"}],"name":"getChainlinkPriceInUSD","outputs":[{"internalType":"int256","name":"chainlinkPriceInUSD","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"}],"name":"getPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"uint80","name":"_roundId","type":"uint80"},{"internalType":"contract IAggregatorV3","name":"aggregator","type":"address"}],"name":"getRoundInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"updateTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_inputTokenAddr","type":"address"},{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"updateTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getSparkTokenPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"}],"name":"getSparkTokenPriceInUSD","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserData","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"inLockDownMode","type":"bool"},{"internalType":"bool","name":"inPermitDisabledMode","type":"bool"},{"internalType":"address","name":"borrowVault","type":"address"},{"internalType":"uint256","name":"borrowAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"borrowAmountInAsset","type":"uint256"},{"components":[{"internalType":"address","name":"collateralVault","type":"address"},{"internalType":"bool","name":"usedInBorrow","type":"bool"},{"internalType":"uint256","name":"collateralAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInAsset","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInUSD","type":"uint256"}],"internalType":"struct EulerV2View.UserCollateralInfo[]","name":"collaterals","type":"tuple[]"}],"internalType":"struct EulerV2View.UserData","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"getUsersData","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"inLockDownMode","type":"bool"},{"internalType":"bool","name":"inPermitDisabledMode","type":"bool"},{"internalType":"address","name":"borrowVault","type":"address"},{"internalType":"uint256","name":"borrowAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"borrowAmountInAsset","type":"uint256"},{"components":[{"internalType":"address","name":"collateralVault","type":"address"},{"internalType":"bool","name":"usedInBorrow","type":"bool"},{"internalType":"uint256","name":"collateralAmountInUnit","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInAsset","type":"uint256"},{"internalType":"uint256","name":"collateralAmountInUSD","type":"uint256"}],"internalType":"struct EulerV2View.UserCollateralInfo[]","name":"collaterals","type":"tuple[]"}],"internalType":"struct EulerV2View.UserData[]","name":"data","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getVaultCollaterals","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"bool","name":"isEscrowed","type":"bool"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collateralsInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getVaultInfoFull","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"bool","name":"isEscrowed","type":"bool"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collaterals","type":"tuple[]"},{"internalType":"uint16","name":"maxLiquidationDiscount","type":"uint16"},{"internalType":"uint256","name":"liquidationCoolOffTime","type":"uint256"},{"internalType":"bool","name":"badDebtSocializationEnabled","type":"bool"},{"internalType":"address","name":"unitOfAccount","type":"address"},{"internalType":"uint256","name":"unitOfAccountInUsd","type":"uint256"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"address","name":"balanceTrackerAddress","type":"address"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"uint256","name":"interestFee","type":"uint256"}],"internalType":"struct EulerV2View.VaultInfoFull","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_vaults","type":"address[]"}],"name":"getVaultsInfosFull","outputs":[{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"components":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"address","name":"assetAddr","type":"address"},{"internalType":"string","name":"vaultSymbol","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"bool","name":"isEscrowed","type":"bool"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"totalBorrows","type":"uint256"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint16","name":"borrowLTV","type":"uint16"},{"internalType":"uint16","name":"liquidationLTV","type":"uint16"},{"internalType":"uint16","name":"initialLiquidationLTV","type":"uint16"},{"internalType":"uint48","name":"targetTimestamp","type":"uint48"},{"internalType":"uint32","name":"rampDuration","type":"uint32"},{"internalType":"uint256","name":"interestFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct EulerV2View.CollateralInfo[]","name":"collaterals","type":"tuple[]"},{"internalType":"uint16","name":"maxLiquidationDiscount","type":"uint16"},{"internalType":"uint256","name":"liquidationCoolOffTime","type":"uint256"},{"internalType":"bool","name":"badDebtSocializationEnabled","type":"bool"},{"internalType":"address","name":"unitOfAccount","type":"address"},{"internalType":"uint256","name":"unitOfAccountInUsd","type":"uint256"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"assetPriceInUnit","type":"uint256"},{"internalType":"uint256","name":"sharePriceInUnit","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"address","name":"balanceTrackerAddress","type":"address"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"governorAdmin","type":"address"},{"internalType":"uint256","name":"interestFee","type":"uint256"}],"internalType":"struct EulerV2View.VaultInfoFull[]","name":"data","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_btcPrice","type":"int256"}],"name":"getWBtcPrice","outputs":[{"internalType":"int256","name":"wBtcPrice","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_stEthPrice","type":"int256"}],"name":"getWStEthPrice","outputs":[{"internalType":"int256","name":"wStEthPrice","type":"int256"}],"stateMutability":"view","type":"function"}],
|
|
1036
1036
|
"networks": {
|
|
1037
|
-
"1": { "address": "
|
|
1037
|
+
"1": { "address": "0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967" }
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
package/src/eulerV2/index.ts
CHANGED
|
@@ -54,11 +54,22 @@ export const getEulerV2MarketsData = async (web3: Web3, network: NetworkNumber,
|
|
|
54
54
|
const utilizationRate = getUtilizationRate(collateral.totalBorrows, new Dec(collateral.totalBorrows).plus(collateral.cash).toString());
|
|
55
55
|
|
|
56
56
|
const supplyRate = getEulerV2SupplyRate(borrowRate, utilizationRate, collateral.interestFee);
|
|
57
|
+
|
|
58
|
+
const isEscrow = collateral.isEscrowed;
|
|
59
|
+
const isGoverned = !compareAddresses(collateral.governorAdmin, ZERO_ADDRESS);
|
|
60
|
+
|
|
61
|
+
const vaultType = isEscrow
|
|
62
|
+
? EulerV2VaultType.Escrow
|
|
63
|
+
: (
|
|
64
|
+
isGoverned ? EulerV2VaultType.Governed : EulerV2VaultType.Ungoverned
|
|
65
|
+
);
|
|
57
66
|
return ({
|
|
58
67
|
vaultAddress: collateral.vaultAddr,
|
|
59
68
|
assetAddress: collateral.assetAddr,
|
|
60
69
|
symbol: assetInfo.symbol,
|
|
61
70
|
vaultSymbol: collateral.vaultSymbol,
|
|
71
|
+
name: collateral.name,
|
|
72
|
+
vaultType,
|
|
62
73
|
decimals,
|
|
63
74
|
liquidationRatio: new Dec(collateral.liquidationLTV).div(10_000).toString(),
|
|
64
75
|
collateralFactor: new Dec(collateral.borrowLTV).div(10_000).toString(),
|
|
@@ -184,6 +195,7 @@ export const EMPTY_EULER_V2_DATA = {
|
|
|
184
195
|
inPermitDisabledMode: false,
|
|
185
196
|
lastUpdated: Date.now(),
|
|
186
197
|
hasBorrowInDifferentVault: false,
|
|
198
|
+
addressSpaceTakenByAnotherAccount: false,
|
|
187
199
|
};
|
|
188
200
|
|
|
189
201
|
export const getEulerV2AccountData = async (
|
|
@@ -209,13 +221,11 @@ export const getEulerV2AccountData = async (
|
|
|
209
221
|
|
|
210
222
|
const isInUSD = marketData.isInUSD;
|
|
211
223
|
|
|
212
|
-
// TODO: maybe not the best practice to get decimals from tokens package
|
|
213
224
|
const parsingDecimals = isInUSD ? 18 : getAssetInfoByAddress(marketData.unitOfAccount).decimals;
|
|
214
225
|
const contract = EulerV2ViewContract(web3, network);
|
|
215
226
|
|
|
216
227
|
const loanData = await contract.methods.getUserData(address).call();
|
|
217
228
|
const usedAssets: EulerV2UsedAssets = {};
|
|
218
|
-
|
|
219
229
|
// there is no user position check for a specific market, only global check
|
|
220
230
|
// but we need to make sure it works for the UI and show position only for the selected market
|
|
221
231
|
if (!compareAddresses(loanData.borrowVault, selectedMarket.marketAddress)) {
|
|
@@ -226,6 +236,7 @@ export const getEulerV2AccountData = async (
|
|
|
226
236
|
inLockDownMode: false,
|
|
227
237
|
inPermitDisabledMode: false,
|
|
228
238
|
hasBorrowInDifferentVault: !compareAddresses(loanData.borrowVault, ZERO_ADDRESS),
|
|
239
|
+
addressSpaceTakenByAnotherAccount: !compareAddresses(loanData.owner, address) && !compareAddresses(loanData.owner, ZERO_ADDRESS),
|
|
229
240
|
};
|
|
230
241
|
} else {
|
|
231
242
|
payload = {
|
|
@@ -234,7 +245,7 @@ export const getEulerV2AccountData = async (
|
|
|
234
245
|
borrowAmountInUnit: loanData.borrowAmountInUnit,
|
|
235
246
|
inLockDownMode: loanData.inLockDownMode,
|
|
236
247
|
inPermitDisabledMode: loanData.inPermitDisabledMode,
|
|
237
|
-
|
|
248
|
+
addressSpaceTakenByAnotherAccount: !compareAddresses(loanData.owner, address) && !compareAddresses(loanData.owner, ZERO_ADDRESS),
|
|
238
249
|
};
|
|
239
250
|
|
|
240
251
|
const borrowedInUnit = getEthAmountForDecimals(loanData.borrowAmountInUnit, parsingDecimals);
|
|
@@ -11,16 +11,6 @@ export const eUSDC2 = (networkId: NetworkNumber): EulerV2Market => ({
|
|
|
11
11
|
marketAddress: '0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9',
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
export const eUSDC8 = (networkId: NetworkNumber): EulerV2Market => ({
|
|
15
|
-
chainIds: [NetworkNumber.Eth],
|
|
16
|
-
label: 'Stablecoin Maxi USDC',
|
|
17
|
-
shortLabel: 'eUSDC-8',
|
|
18
|
-
value: EulerV2Versions.eUSDC8,
|
|
19
|
-
asset: 'USDC',
|
|
20
|
-
secondLabel: 'Market',
|
|
21
|
-
marketAddress: '0xce45EF0414dE3516cAF1BCf937bF7F2Cf67873De',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
14
|
export const eWETH2 = (networkId: NetworkNumber): EulerV2Market => ({
|
|
25
15
|
chainIds: [NetworkNumber.Eth],
|
|
26
16
|
label: 'Euler Prime WETH',
|
|
@@ -33,6 +23,5 @@ export const eWETH2 = (networkId: NetworkNumber): EulerV2Market => ({
|
|
|
33
23
|
|
|
34
24
|
export const EulerV2Markets = (networkId: NetworkNumber) => ({
|
|
35
25
|
[EulerV2Versions.eUSDC2]: eUSDC2(networkId),
|
|
36
|
-
[EulerV2Versions.eUSDC8]: eUSDC8(networkId),
|
|
37
26
|
[EulerV2Versions.eWETH2]: eWETH2(networkId),
|
|
38
27
|
}) as const;
|
|
@@ -130,6 +130,9 @@ export declare namespace EulerV2View {
|
|
|
130
130
|
string,
|
|
131
131
|
string,
|
|
132
132
|
string,
|
|
133
|
+
string,
|
|
134
|
+
string,
|
|
135
|
+
boolean,
|
|
133
136
|
number | string | BN,
|
|
134
137
|
number | string | BN,
|
|
135
138
|
number | string | BN,
|
|
@@ -148,6 +151,9 @@ export declare namespace EulerV2View {
|
|
|
148
151
|
vaultAddr: string;
|
|
149
152
|
assetAddr: string;
|
|
150
153
|
vaultSymbol: string;
|
|
154
|
+
name: string;
|
|
155
|
+
governorAdmin: string;
|
|
156
|
+
isEscrowed: boolean;
|
|
151
157
|
decimals: number | string | BN;
|
|
152
158
|
sharePriceInUnit: number | string | BN;
|
|
153
159
|
assetPriceInUnit: number | string | BN;
|
|
@@ -169,6 +175,9 @@ export declare namespace EulerV2View {
|
|
|
169
175
|
string,
|
|
170
176
|
string,
|
|
171
177
|
string,
|
|
178
|
+
boolean,
|
|
179
|
+
string,
|
|
180
|
+
string,
|
|
172
181
|
string,
|
|
173
182
|
string,
|
|
174
183
|
string,
|
|
@@ -185,6 +194,9 @@ export declare namespace EulerV2View {
|
|
|
185
194
|
vaultAddr: string;
|
|
186
195
|
assetAddr: string;
|
|
187
196
|
vaultSymbol: string;
|
|
197
|
+
name: string;
|
|
198
|
+
governorAdmin: string;
|
|
199
|
+
isEscrowed: boolean;
|
|
188
200
|
decimals: string;
|
|
189
201
|
sharePriceInUnit: string;
|
|
190
202
|
assetPriceInUnit: string;
|