Skip to content

AaveDataProvider

AaveProtocolDataProvider

Peripheral contract to collect and pre-process information from the Pool.

Code available on github.

Methods

getAllReservesTokens

function getAllReservesTokens() external view returns (TokenData[] memory)

Returns list of the existing reserves in the pool.

Return Value

TypeDescription
stringThe symbol of the underlying reserve asset
addressThe address of the underlying reserve asset

getAllSpTokens

function getAllSpTokens() external view returns (TokenData[] memory)

Returns list of the existing SpTokens in the pool.

Return Value

TypeDescription
stringThe symbol of spToken of the reserve
addressThe address of spToken of the reserve

getReserveConfigurationData

function getReserveConfigurationData(address asset) external view returns (....)

Returns the configuration data of the reserve as described below:

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The number of decimals of the reserve
uint256The ltv of the reserve
uint256The liquidationThreshold of the reserve
uint256The liquidationBonus of the reserve
uint256The reserveFactor of the reserve
boolTrue if the usage as collateral is enabled, false otherwise
boolTrue if borrowing is enabled, false otherwise
boolTrue if stable rate borrowing is enabled, false otherwise
boolTrue if reserve is active, false otherwise
boolTrue if reserve is frozen, false otherwise

getReserveEModeCategory

function getReserveEModeCategory(address asset) external view returns (uint256)

Returns reserve's efficiency mode category.

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The number of decimals of the reserve

getReserveCaps

function getReserveCaps(address asset) external view returns (uint256 borrowCap, uint256 supplyCap)

Returns the caps parameters of the reserve

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The borrow cap of the reserve
uint256The supply cap of the reserve

getPaused

function getPaused(address asset) external view returns (bool isPaused)

Returns true if the pool is paused.

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
boolTrue if the pool is paused

getSiloedBorrowing

function getSiloedBorrowing(address asset) external view returns (bool)

Returns true if the asset is siloed for borrowing.

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
boolTrue if the pool is paused

getLiquidationProtocolFee

function getLiquidationProtocolFee(address asset) external view returns (uint256)

Returns the protocol fee on the liquidation bonus.

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The protocol fee on liquidation

getUnbackedMintCap

function getUnbackedMintCap(address asset) external view returns (uint256)

Returns the unbacked mint cap of the reserve

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The unbacked mint cap of the reserve

getDebtCeiling

function getDebtCeiling(address asset) external view returns (uint256)

Returns the debt ceiling of the reserve

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The debt ceiling of the reserve

getDebtCeilingDecimals

function getDebtCeilingDecimals() external pure returns (uint256)

Returns the debt ceiling decimals

Return Value

TypeDescription
uint256The debt ceiling decimals

getReserveData

function getReserveData(address asset) external view override returns(....)

Returns the following reserve data 👇🏻

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The amount of unbacked spTokens of the reserve
uint256The scaled amount of tokens accrued to treasury that is to be minted
uint256The total supply of the spToken
uint256The total stable debt of the reserve
uint256The total variable debt of the reserve
uint256The liquidity rate of the reserve
uint256The variable borrow rate of the reserve
uint256The stable borrow rate of the reserve
uint256The average stable borrow rate of the reserve
uint256The liquidity index of the reserve
uint256The variable borrow index of the reserve
uint40The timestamp of the last update of the reserve

getSpTokenTotalSupply

function getSpTokenTotalSupply(address asset) external view override returns (uint256)

Returns the total supply of spTokens for a given asset

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The total supply of the spToken

getTotalDebt

function getTotalDebt(address asset) external view override returns (uint256)

Returns the total debt for a given asset

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
uint256The total debt (stable + variable) for an asset

getUserReserveData

function getUserReserveData(address asset, address user) external view returns (...)

Returns the following user reserve data

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
useraddressThe address of the user

Return Value

TypeDescription
uint256The current SpToken balance of the user
uint256The current stable debt of the user
uint256The current variable debt of the user
uint256The principal stable debt of the user
uint256The scaled variable debt of the user
uint256The stable borrow rate of the user
uint256The liquidity rate of the reserve
uint40The timestamp of the last update of the user stable rate
boolTrue if the user is using the asset as collateral, else false

getReserveTokensAddresses

function getReserveTokensAddresses(address asset) external view returns (address spTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress)

Returns the addresses of spToken, stableDebtToken and variableDebtToken of the reserve

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
addressThe SpToken address of the reserve
addressThe StableDebtToken address of the reserve
addressThe VariableDebtToken address of the reserve

getInterestRateStrategyAddress

function getInterestRateStrategyAddress(address asset) external view returns (address irStrategyAddress)

Returns the address of the Interest Rate strategy

Call Params

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Value

TypeDescription
addressThe address of the Interest Rate strategy

ABI

[
    {
        "inputs": [
            {
                "internalType": "contract IPoolAddressesProvider",
                "name": "addressesProvider",
                "type": "address"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "constructor"
    },
    {
        "inputs": [],
        "name": "ADDRESSES_PROVIDER",
        "outputs": [
            {
                "internalType": "contract IPoolAddressesProvider",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getSpTokenTotalSupply",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getAllSpTokens",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "string",
                        "name": "symbol",
                        "type": "string"
                    },
                    {
                        "internalType": "address",
                        "name": "tokenAddress",
                        "type": "address"
                    }
                ],
                "internalType": "struct SparkProtocolDataProvider.TokenData[]",
                "name": "",
                "type": "tuple[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getAllReservesTokens",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "string",
                        "name": "symbol",
                        "type": "string"
                    },
                    {
                        "internalType": "address",
                        "name": "tokenAddress",
                        "type": "address"
                    }
                ],
                "internalType": "struct SparkProtocolDataProvider.TokenData[]",
                "name": "",
                "type": "tuple[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getDebtCeiling",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getDebtCeilingDecimals",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "pure",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getInterestRateStrategyAddress",
        "outputs": [
            {
                "internalType": "address",
                "name": "irStrategyAddress",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getLiquidationProtocolFee",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getPaused",
        "outputs": [
            {
                "internalType": "bool",
                "name": "isPaused",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getReserveCaps",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "borrowCap",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "supplyCap",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "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"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "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": "totalSpToken",
                "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"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getReserveTokensAddresses",
        "outputs": [
            {
                "internalType": "address",
                "name": "spTokenAddress",
                "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"
            }
        ],
        "name": "getSiloedBorrowing",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getTotalDebt",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            }
        ],
        "name": "getUnbackedMintCap",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "asset",
                "type": "address"
            },
            {
                "internalType": "address",
                "name": "user",
                "type": "address"
            }
        ],
        "name": "getUserReserveData",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "currentSpTokenBalance",
                "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"
    }
]