diff --git a/blockchain/aave-v3/aave-v3-pool-data-provider.ts b/blockchain/aave-v3/aave-v3-pool-data-provider.ts index bb3aaa3a34..a104008c61 100644 --- a/blockchain/aave-v3/aave-v3-pool-data-provider.ts +++ b/blockchain/aave-v3/aave-v3-pool-data-provider.ts @@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js' import { NetworkIds } from 'blockchain/networks' import { amountFromRay, amountFromWei } from 'blockchain/utils' import { warnIfAddressIsZero } from 'helpers/warnIfAddressIsZero' +import { zero } from 'helpers/zero' import { AaveV3PoolDataProvider__factory } from 'types/ethers-contracts' import type { BaseParameters } from './utils' @@ -194,21 +195,10 @@ export interface AaveV3EModeForAssetParameters extends BaseParameters { token: string } -export function getAaveV3EModeCategoryForAsset({ - token, - networkId, -}: AaveV3EModeForAssetParameters): Promise { - const { contract, tokenMappings } = networkMappings[networkId]() - const address = wethToEthAddress(tokenMappings, token) - warnIfAddressIsZero( - address, - networkId, - 'aaveV3PoolDataProvider', - 'getAaveV3EModeCategoryForAsset', - ) - return contract.getReserveEModeCategory(address).then((result) => { - return new BigNumber(result.toString()) - }) +export function getAaveV3EModeCategoryForAsset( + _props: AaveV3EModeForAssetParameters, +): Promise { + return Promise.resolve(zero) } export interface AaveV3ReserveCapParameters extends BaseParameters { diff --git a/blockchain/abi/aave-v3-pool-data-provider.json b/blockchain/abi/aave-v3-pool-data-provider.json index e0b5a44a87..5729992e58 100644 --- a/blockchain/abi/aave-v3-pool-data-provider.json +++ b/blockchain/abi/aave-v3-pool-data-provider.json @@ -14,31 +14,15 @@ "inputs": [], "name": "ADDRESSES_PROVIDER", "outputs": [ - { - "internalType": "contract IPoolAddressesProvider", - "name": "", - "type": "address" - } + { "internalType": "contract IPoolAddressesProvider", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getATokenTotalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -48,16 +32,8 @@ "outputs": [ { "components": [ - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } + { "internalType": "string", "name": "symbol", "type": "string" }, + { "internalType": "address", "name": "tokenAddress", "type": "address" } ], "internalType": "struct IPoolDataProvider.TokenData[]", "name": "", @@ -73,16 +49,8 @@ "outputs": [ { "components": [ - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } + { "internalType": "string", "name": "symbol", "type": "string" }, + { "internalType": "address", "name": "tokenAddress", "type": "address" } ], "internalType": "struct IPoolDataProvider.TokenData[]", "name": "", @@ -93,442 +61,159 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getDebtCeiling", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getDebtCeilingDecimals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getFlashLoanEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getInterestRateStrategyAddress", - "outputs": [ - { - "internalType": "address", - "name": "irStrategyAddress", - "type": "address" - } - ], + "outputs": [{ "internalType": "address", "name": "irStrategyAddress", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getIsVirtualAccActive", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getLiquidationProtocolFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getPaused", - "outputs": [ - { - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "isPaused", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getReserveCaps", "outputs": [ - { - "internalType": "uint256", - "name": "borrowCap", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyCap", - "type": "uint256" - } + { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, + { "internalType": "uint256", "name": "supplyCap", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getReserveConfigurationData", "outputs": [ - { - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ltv", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationThreshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationBonus", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactor", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "usageAsCollateralEnabled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "borrowingEnabled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "stableBorrowRateEnabled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isActive", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isFrozen", - "type": "bool" - } + { "internalType": "uint256", "name": "decimals", "type": "uint256" }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThreshold", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationBonus", "type": "uint256" }, + { "internalType": "uint256", "name": "reserveFactor", "type": "uint256" }, + { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, + { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, + { "internalType": "bool", "name": "stableBorrowRateEnabled", "type": "bool" }, + { "internalType": "bool", "name": "isActive", "type": "bool" }, + { "internalType": "bool", "name": "isFrozen", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getReserveData", "outputs": [ - { - "internalType": "uint256", - "name": "unbacked", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accruedToTreasuryScaled", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalStableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalVariableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidityRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "variableBorrowRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableBorrowRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "averageStableBorrowRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidityIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "variableBorrowIndex", - "type": "uint256" - }, - { - "internalType": "uint40", - "name": "lastUpdateTimestamp", - "type": "uint40" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], - "name": "getReserveEModeCategory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "uint256", "name": "unbacked", "type": "uint256" }, + { "internalType": "uint256", "name": "accruedToTreasuryScaled", "type": "uint256" }, + { "internalType": "uint256", "name": "totalAToken", "type": "uint256" }, + { "internalType": "uint256", "name": "totalStableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "totalVariableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidityRate", "type": "uint256" }, + { "internalType": "uint256", "name": "variableBorrowRate", "type": "uint256" }, + { "internalType": "uint256", "name": "stableBorrowRate", "type": "uint256" }, + { "internalType": "uint256", "name": "averageStableBorrowRate", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidityIndex", "type": "uint256" }, + { "internalType": "uint256", "name": "variableBorrowIndex", "type": "uint256" }, + { "internalType": "uint40", "name": "lastUpdateTimestamp", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getReserveTokensAddresses", "outputs": [ - { - "internalType": "address", - "name": "aTokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "stableDebtTokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "variableDebtTokenAddress", - "type": "address" - } + { "internalType": "address", "name": "aTokenAddress", "type": "address" }, + { "internalType": "address", "name": "stableDebtTokenAddress", "type": "address" }, + { "internalType": "address", "name": "variableDebtTokenAddress", "type": "address" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getSiloedBorrowing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getTotalDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getUnbackedMintCap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } ], "name": "getUserReserveData", "outputs": [ - { - "internalType": "uint256", - "name": "currentATokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentStableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentVariableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "principalStableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "scaledVariableDebt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableBorrowRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidityRate", - "type": "uint256" - }, - { - "internalType": "uint40", - "name": "stableRateLastUpdated", - "type": "uint40" - }, - { - "internalType": "bool", - "name": "usageAsCollateralEnabled", - "type": "bool" - } + { "internalType": "uint256", "name": "currentATokenBalance", "type": "uint256" }, + { "internalType": "uint256", "name": "currentStableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "currentVariableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "principalStableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "scaledVariableDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "stableBorrowRate", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidityRate", "type": "uint256" }, + { "internalType": "uint40", "name": "stableRateLastUpdated", "type": "uint40" }, + { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" } ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getVirtualUnderlyingBalance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" } ] diff --git a/package.json b/package.json index 0187ca7978..1d6db4ee63 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "@lifi/wallet-management": "^2.6.1", "@lifi/widget": "^2.10.2", "@metamask/eth-sig-util": "^5.0.2", - "@oasisdex/addresses": "0.1.80", + "@oasisdex/addresses": "0.1.84", "@oasisdex/automation": "1.6.5-morpho.6", - "@oasisdex/dma-library": "0.6.66", + "@oasisdex/dma-library": "0.6.67", "@oasisdex/multiply": "^0.2.11", "@oasisdex/transactions": "0.1.4-alpha.0", "@oasisdex/utils": "^0.0.8", diff --git a/yarn.lock b/yarn.lock index ddde6796fe..5b9c5b715d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2502,10 +2502,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oasisdex/addresses@0.1.80": - version "0.1.80" - resolved "https://registry.yarnpkg.com/@oasisdex/addresses/-/addresses-0.1.80.tgz#235ad8f8d743f10bef0381e424d64d6689b304b3" - integrity sha512-0zd9QaBamrJ2ssC2OBvAvuQMf1DKhRwZ9GE8dvuwXxN3Ec9T9kJE15porBIjeyF5+W+Bt0nacp0ek2pZtYb+3w== +"@oasisdex/addresses@0.1.84": + version "0.1.84" + resolved "https://registry.yarnpkg.com/@oasisdex/addresses/-/addresses-0.1.84.tgz#5b506551d9454ed621f17fef736e5e27dc27edc2" + integrity sha512-qaY7sXUsq4n9i7otCbfmb44Et1rNn9dAe+WSXgyjFost9ZLa/oZC27ojBEoF4QnZDr7Dcje0scHc+6yoJzkYeg== "@oasisdex/automation@1.6.5-morpho.6": version "1.6.5-morpho.6" @@ -2514,10 +2514,10 @@ dependencies: ethers "^5.6.2" -"@oasisdex/dma-library@0.6.66": - version "0.6.66" - resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.66.tgz#711b79bbf90d8f512e3ed718ea5529ecde1e5512" - integrity sha512-x5fOVklFa19j971WcImZkheIVzqCRflhDpthXFIaJqJDDCWdxRlobq3G4s8iuziuL0ch1lmSXyqrU8To2VRCAA== +"@oasisdex/dma-library@0.6.67": + version "0.6.67" + resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.67.tgz#3fab93eaf74670f77b7b29a365157678c425eb2d" + integrity sha512-0aQBBiNtY09pRhxn3B/vw3KulI97s4i0SA7vbhQUMcIPlupS/9qxuSiPO2gzLum5R10XGUVcpTO1JljsqMt4cQ== dependencies: bignumber.js "9.0.1" ethers "^5.7.2"