routing_data#

tradeexecutor.ethereum.routing_data Python module in Trading Strategy framework.

Module description#

Default routing models for Uniswap v2 like exchange.

Describe which smart contract addresses are used to make a trade. Map factory addresses, router addresses and quote token addresses.

  • This takes one of the default routing options and gives the routing model for it

  • The routing model consists of smart contract addresses needed to trade

  • Parameters needed for basic routing for an Uniswap v2 compatible exchange:

    • Factory smart contract address

    • Router smart contract address

    • Pair contract “init code hash”

    • Wrapped token address

    • Stablecoin addresses

    • Wrapped token/stablecoin pool address

See also tradeexecutor.strategy.default_routing_options.TradeRouting that gives the users the choices for the trade routing options in their strategy module.

Classes#

RoutingData

Describe raw smart contract order routing data.

Functions#

create_compatible_routing(routing_type, ...)

Create compatible routing.

create_uniswap_v2_compatible_routing(...)

Set up Uniswap v2 compatible routing.

create_uniswap_v3_compatible_routing(...)

Set up Uniswap v3 compatible routing.

get_backtest_routing_model(routing_type, ...)

Get routing options for backtests.

get_pancake_default_routing_parameters(...)

Generate routing using PancakeSwap v2 router.

get_quickswap_default_routing_parameters(...)

Generate routing using Trader Joe router.

get_routing_model(execution_context, ...)

Create trade routing model for the strategy.

get_trader_joe_default_routing_parameters(...)

Generate routing using Trader Joe router.

get_uniswap_v2_compatible_routing_types()

get_uniswap_v2_default_routing_parameters(...)

Generate routing using Uniswap v2 router.

get_uniswap_v3_compatible_routing_types_eth()

get_uniswap_v3_compatible_routing_types_poly()

get_uniswap_v3_ethereum_default_routing_parameters(...)

Generate routing using Uniswap V3 router for Ethereum

get_uniswap_v3_polygon_default_routing_parameters(...)

Generate routing using Uniswap V3 router for Polygon

validate_reserve_currency(routing_type, ...)

Assert that reserve currency matches routing type