UniswapV3Quoter

Documentation for eth_defi.vault.valuation.UniswapV3Quoter Python class.

class UniswapV3Quoter

Bases: eth_defi.vault.valuation.ValuationQuoter

Handle Uniswap v3 quoters using QuoterV2 contract.

Attributes summary

dex_hint

signature_string

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

__init__(quoter, debug=False, fee_hook=<function _fee_hook>)
Parameters
  • quoter (web3.contract.contract.Contract) –

  • debug (bool) –

format_path(route)

Get human-readable route path line.

Return type

str

generate_routes(source_token, target_token, intermediate_tokens, amount, debug)

Create routes we need to test on Uniswap v2

Parameters
Return type

Iterable[eth_defi.vault.valuation.Route]

get_path_combinations(source_token, target_token, intermediate_tokens)

Generate Uniswap v3 swap paths and fee with all supported intermediate tokens

Parameters
Return type

Iterable[tuple[list[eth_typing.evm.HexAddress], list[int]]]

handle_onchain_return_value(wrapper, raw_return_value)

Convert swapExactTokensForTokens() return value to tokens we receive

Parameters
Return type

Optional[decimal.Decimal]