analyse_4626_flow_transaction

Documentation for eth_defi.erc_4626.analysis.analyse_4626_flow_transaction function.

analyse_4626_flow_transaction(vault, tx_hash, tx_receipt, direction, hot_wallet=True, *, deposit_event_signature=None, redemption_event_signature=None)

Analyse a ERC-4626 deposit/redeem transaction.

Figure out

  • The success of the deposit

  • Slippage, etc.

Warning

Do not use TradeSuccess.price directly, as this price depends on in which order token0 and token1 are in the pool smart contract. Use TradeSuccess.get_human_price() instead.

Parameters
  • tx_receipt (dict) – Transaction receipt

  • hot_wallet –

    Is this a hot wallet originiated transaction or contract to contract transaction.

    We can perform additioanl checks with hot wallet transactions.

  • deposit_event_signature (Optional[str]) – Explicit event signature for a vault that overloads Deposit. This is only used for the deposit direction; plain ERC-4626 vaults leave it unset and continue to use Deposit by name.

  • redemption_event_signature (Optional[str]) – Explicit event signature for a vault that overloads Withdraw. This is only used for the redemption direction; plain ERC-4626 vaults leave it unset and continue to use Withdraw by name.

  • vault (eth_defi.erc_4626.vault.ERC4626Vault) –

  • tx_hash (Union[str, bytes]) –

  • direction (Literal['deposit', 'redeem']) –

Return type

Union[eth_defi.trade.TradeSuccess, eth_defi.trade.TradeFail]