routing_data#

tradeexecutor.ethereum.routing_data module.

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_uniswap_v2_compatible_routing(...)

Set up Uniswap v2 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_default_routing_parameters(...)

Generate routing using Uniswap v2 router.