AaveLiquidationReader

Documentation for eth_defi.aave_v3.liquidation.AaveLiquidationReader Python class.

class AaveLiquidationReader

Bases: object

Methods summary

__init__(client, web3[, hypersync_read_timeout])

build_query(start_block, end_block)

Create liquidation event query.

decode_event(chain_id, chain_name, log, ...)

Decode liquidation event from the log data.

fetch_liquidations(start_block, end_block)

fetch_liquidations_async(start_block, end_block)

Identify smart contracts emitting 4626 like events.

resolve_token(address)

Resolve token address to checksum address.

__init__(client, web3, hypersync_read_timeout=90)
Parameters
  • client (hypersync.HypersyncClient) –

  • web3 (web3.main.Web3) –

  • hypersync_read_timeout (float) –

resolve_token(address)

Resolve token address to checksum address.

  • Cached

Parameters

address (eth_typing.evm.HexAddress) –

Return type

eth_defi.token.TokenDetails

build_query(start_block, end_block)

Create liquidation event query.

The event in the question:

// Event Signature
// 0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286

LiquidationCall(
    address collateralAsset,
    address debtAsset,
    address user,
    uint256 debtToCover,
    uint256 liquidatedCollateralAmount,
    address liquidator,
    bool receiveAToken
)

See also:

Parameters
  • start_block (int) –

  • end_block (int) –

decode_event(chain_id, chain_name, log, block_lookup)

Decode liquidation event from the log data.

  • Convert raw addresses and amounts to more manageable format

Parameters
  • chain_id (int) –

  • chain_name (str) –

  • log (hypersync.Log) –

  • block_lookup (dict) –

Return type

eth_defi.aave_v3.liquidation.AaveLiquidationEvent

async fetch_liquidations_async(start_block, end_block, display_progress=True)

Identify smart contracts emitting 4626 like events.

Parameters
  • start_block (int) –

  • end_block (int) –

Return type

AsyncIterable[eth_defi.aave_v3.liquidation.AaveLiquidationEvent]