fetch_aave_reserves_snapshot

Documentation for eth_defi.aave_v3.reserve.fetch_aave_reserves_snapshot function.

fetch_aave_reserves_snapshot(web3, block_identifier=None)[source]

Get a snapshot of all data of Aave reserves at a certain point of time.

See JSONSerialisableReserveData for notes on how to transform the output to useful and/or human readable.

Example:

# Read Polygon Aave v3 reserves data at current block
snapshot = fetch_aave_reserves_snapshot(web3)

Example output:

{'block_number': 46092890,
 'block_hash': '0x66b91e13e66978632d7687fa37d61994a092194dd83ab800c4b3fbbfbbc4b882',
 'timestamp': 1691574096,
 'reserves': {'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063': {'underlyingAsset': '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
   'name': '(PoS) Dai Stablecoin',
   'symbol': 'DAI',
   'decimals': '18',
   'baseLTVasCollateral': '7600',
   'reserveLiquidationThreshold': '8100',
   'reserveLiquidationBonus': '10500',
   'reserveFactor': '1000',
   'usageAsCollateralEnabled': True,
   'borrowingEnabled': True,
   'stableBorrowRateEnabled': True,
   'isActive': True,
   'isFrozen': False,
   'liquidityIndex': '1022026858597482843618393800',
   'variableBorrowIndex': '1039320957656647363864994430',
   'liquidityRate': '28850861922310792585422606',
   'variableBorrowRate': '39579583454495318816309720',
   'stableBorrowRate': '54947447931811914852038715',
   'lastUpdateTimestamp': '1691574072',
   'aTokenAddress': '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
   'stableDebtTokenAddress': '0xd94112B5B62d53C9402e7A60289c6810dEF1dC9B',
   'variableDebtTokenAddress': '0x8619d80FB0141ba7F184CbF22fd724116D9f7ffC',
   'interestRateStrategyAddress': '0xA9F3C3caE095527061e6d270DBE163693e6fda9D',
   'availableLiquidity': '1889483036044495898670614',
   'totalPrincipalStableDebt': '411830124610128093102375',
   'averageStableRate': '55554322387136738659305167',
   'stableDebtLastUpdateTimestamp': '1691573968',
   'totalScaledVariableDebt': '6509001421349391268535081',
   'priceInMarketReferenceCurrency': '99970000',
   'priceOracle': '0x4746DeC9e833A82EC7C2C1356372CcF2cfcD2F3D',
   'variableRateSlope1': '40000000000000000000000000',
   'variableRateSlope2': '750000000000000000000000000',
   'stableRateSlope1': '5000000000000000000000000',
   'stableRateSlope2': '750000000000000000000000000',
   'baseStableBorrowRate': '50000000000000000000000000',
   'baseVariableBorrowRate': '0',
   'optimalUsageRatio': '800000000000000000000000000',
   'isPaused': False,
   'isSiloedBorrowing': False,
   'accruedToTreasury': '142442743829638527556',
   'unbacked': '0',
   'isolationModeTotalDebt': '0',
   'flashLoanEnabled': True,
   'debtCeiling': '0',
   'debtCeilingDecimals': '2',
   'eModeCategoryId': '1',
   'borrowCap': '30000000',
   'supplyCap': '45000000',
   'eModeLtv': '9300',
   'eModeLiquidationThreshold': '9500',
   'eModeLiquidationBonus': '10100',
   'eModePriceSource': '0x0000000000000000000000000000000000000000',
   'eModeLabel': 'Stablecoins',
   'borrowableInIsolation': True},
  '0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39': {'underlyingAsset': '0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39',
   'name': 'ChainLink Token',
   'symbol': 'LINK',
   'decimals': '18',
Parameters
  • web3 (web3.main.Web3) – Web3 connection for some of the chain for which we have Aave v3 contract data available.

  • block_identifier

    Block when to take the snapshot.

    If not given, use the latest block.

Returns

JSON friendly dict where all ints are converted to string

Return type

eth_defi.aave_v3.reserve.JSONSerialisableReserveData