LagoonTokenCompatibilityData
Documentation for eth_defi.erc_4626.vault_protocol.lagoon.lagoon_compatibility.LagoonTokenCompatibilityData Python class.
- class LagoonTokenCompatibilityData
Bases:
objectWas an ERC-20 compatible with Lagoon Vault?
Vault can buy and sell the token
Only applicable to Uniswap v2 kind AMMs
Attributes summary
Did we res
estimate_sell_receivedRevert reason we captured
sell_block_numbersell_resultcreated_atWhat was the base address of the token
pair_addressUsed routing path
tokensavailable_liquidityminimum_liquidity_thresholdbuy_block_numberestimate_buy_receivedbuy_amount_rawbuy_resultbuy_real_receivedMethods summary
__init__(created_at, token_address, ...[, ...])get_base_token_address()get_base_token_symbol()get_quote_token_symbol()Get round trip cost in percents.
has_liquidity()Was the buy operation successful?
Is the token compatible with Lagoon Vault?
Was the sell operation successful?
is_stablecoin_quoted()pformat()Diagnostics dump for debug
- token_address: str
What was the base address of the token
- revert_reason: Optional[str] = None
Revert reason we captured
- cached: bool = False
Did we res
- is_compatible()
Is the token compatible with Lagoon Vault?
- Return type
- is_buy_success()
Was the buy operation successful?
- Return type
- is_sell_success()
Was the sell operation successful?
- Return type
- get_round_trip_cost()
Get round trip cost in percents.
E.g. 0.005 means we paid 50 bps
- pformat()
Diagnostics dump for debug
- Return type
- __init__(created_at, token_address, pair_address, path, tokens, available_liquidity, minimum_liquidity_threshold, buy_block_number, estimate_buy_received, buy_amount_raw, buy_result, buy_real_received, sell_block_number=None, estimate_sell_received=None, sell_result=None, revert_reason=None, cached=False)
- Parameters
created_at (datetime.datetime) –
token_address (str) –
pair_address (str) –
available_liquidity (decimal.Decimal) –
minimum_liquidity_threshold (decimal.Decimal) –
buy_block_number (int) –
estimate_buy_received (int) –
buy_amount_raw (int) –
buy_result (Optional[eth_defi.trade.TradeSuccess]) –
buy_real_received (int) –
sell_result (Optional[eth_defi.trade.TradeSuccess]) –
cached (bool) –
- Return type
None