UniswapV3Quoter
Documentation for eth_defi.vault.valuation.UniswapV3Quoter Python class.
- class UniswapV3Quoter[source]
Handle Uniswap v3 quoters using QuoterV2 contract.
Attributes summary
dex_hint
Quoter signature string for Multicall lib.
Methods summary
__init__
(quoter[, debug, fee_hook])create_multicall_wrapper
(route, amount_in)format_path
(route)Get human-readable route path line.
generate_routes
(source_token, target_token, ...)Create routes we need to test on Uniswap v2
get_path_combinations
(source_token, ...)Generate Uniswap v3 swap paths and fee with all supported intermediate tokens
handle_onchain_return_value
(wrapper, ...)Convert swapExactTokensForTokens() return value to tokens we receive
- signature_string = 'quoteExactInput(bytes,uint256)(uint256,uint160[],uint32[],uint256)'
Quoter signature string for Multicall lib.
https://basescan.org/address/0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a#code
- __init__(quoter, debug=False, fee_hook=<function _fee_hook>)[source]
- Parameters
quoter (web3.contract.contract.Contract) –
debug (bool) –
- generate_routes(source_token, target_token, intermediate_tokens, amount, debug)[source]
Create routes we need to test on Uniswap v2
- Parameters
source_token (eth_defi.token.TokenDetails) –
target_token (eth_defi.token.TokenDetails) –
intermediate_tokens (set[eth_defi.token.TokenDetails]) –
amount (decimal.Decimal) –
debug (bool) –
- Return type
- handle_onchain_return_value(wrapper, raw_return_value)[source]
Convert swapExactTokensForTokens() return value to tokens we receive
- Parameters
wrapper (eth_defi.vault.valuation.ValuationMulticallWrapper) –
raw_return_value (any) –
- Return type
decimal.Decimal | None
- get_path_combinations(source_token, target_token, intermediate_tokens)[source]
Generate Uniswap v3 swap paths and fee with all supported intermediate tokens
- Parameters
source_token (eth_defi.token.TokenDetails) –
target_token (eth_defi.token.TokenDetails) –
intermediate_tokens (set[eth_defi.token.TokenDetails]) –
- Return type