VeloraQuote
Documentation for eth_defi.velora.quote.VeloraQuote Python class.
- class VeloraQuote
Bases:
objectVelora price quote response.
Contains the optimal route and pricing information for a swap.
Example response data:
{"blockNumber": 12345678, "network": 1, "srcToken": "0x...", "srcDecimals": 18, "srcAmount": "1000000000000000000", "destToken": "0x...", "destDecimals": 6, "destAmount": "3500000000", "bestRoute": [...], "gasCostUSD": "5.93", "contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57", "contractMethod": "multiSwap", "srcUSD": "3500.00", "destUSD": "3500.00"}
Attributes summary
buy_tokensell_tokendataMethods summary
__init__(buy_token, sell_token, data)Get the buy amount from the quote.
Get estimated gas cost in USD.
Get the price implied by the quote (buy amount / sell amount).
Get the sell amount from the quote.
pformat()Pretty format the quote data for logging.
- __init__(buy_token, sell_token, data)
- Parameters
buy_token (eth_defi.token.TokenDetails) –
sell_token (eth_defi.token.TokenDetails) –
data (dict) –
- Return type
None
- get_buy_amount()
Get the buy amount from the quote.
- Returns
Amount of buy token we will receive (human-readable decimals)
- Return type
- get_gas_cost_usd()
Get estimated gas cost in USD.
- Returns
Gas cost in USD or None if not available
- Return type
- get_price()
Get the price implied by the quote (buy amount / sell amount).
- Returns
Price as buy_token per sell_token
- Return type
- get_sell_amount()
Get the sell amount from the quote.
- Returns
Amount of sell token we will spend (human-readable decimals)
- Return type
- pformat()
Pretty format the quote data for logging.
- Return type