TradeRouting#

API documentation for tradeexecutor.strategy.default_routing_options.TradeRouting Python class in Trading Strategy framework.

class TradeRouting[source]#

Bases: Enum

What trade routing should the strategy use.

  • These values can be given to trade_routing variable in a strategy.

  • Thus option hides the complexity of the actual routing logic form an average developer.

See also tradeexecutor.ethereum.routing_data for actual routing data implementation.

__init__(*args, **kwds)#

Methods

is_uniswap_v2()

Do we need Uniswap v2 routing model

is_uniswap_v3()

Do we need Uniswap v3 routing model

is_one_delta()

Do we need 1delta routing model

Attributes

pancakeswap_busd

Two or three-legged trades on PancakeSwap.

pancakeswap_usdc

Two or three-legged trades on PancakeSwap.

pancakeswap_usdt

Two or three legged trades on Pancake on BSC

quickswap_usdc

Two or three legged trades on Quickswap on Polygon

quickswap_usdt

Two or three legged trades on Quickswap on Polygon

quickswap_dai

Two or three legged trades on Quickswap on Polygon

trader_joe_usdc

Two or three legged trades on Trader Joe on Avalanche

trader_joe_usdt

Two or three legged trades on Trader Joe on Avalanche

sushi_usdc

Two or three legged trades on Sushiswap on Ethereum mainnet

sushi_usdt

Two or three legged trades on Sushiswap on Ethereum mainnet

uniswap_v2_usdc

Two or three legged trades on Uniswap v2 on Ethereum mainnet

uniswap_v2_usdt

Two or three legged trades on Uniswap V2 on Ethereum

uniswap_v2_dai

Two or three legged trades on Uniswap V2 on Ethereum

uniswap_v3_usdc

Two or three legged trades on Uniswap v3 on Ethereum mainnet

uniswap_v3_usdt

Two or three legged trades on Uniswap v3 on Ethereum mainnet

uniswap_v3_dai

Two or three legged trades on Uniswap v3 on Ethereum mainnet

uniswap_v3_busd

Two or three legged trades on Uniswap v3 on Ethereum mainnet

uniswap_v3_usdc_poly

Two or three legged trades on Uniswap v3 on Polygon mainnet

uniswap_v3_usdt_poly

Two or three legged trades on Uniswap v3 on Polygon mainnet

uniswap_v3_usdc_arbitrum_bridged

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

uniswap_v3_usdc_arbitrum_native

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

uniswap_v3_usdt_arbitrum

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

one_delta_polygon_usdc

Two legged trades on 1delta on Polygon mainnet

user_supplied_routing_model

Use user supplied routing model

ignore

Backtesting only

default

Use any generic USDC routing

pancakeswap_busd = 'pancakeswap_busd'#

Two or three-legged trades on PancakeSwap.

  • Open positions with BUSD quote token.

  • Open positions with WBNB quote token.

pancakeswap_usdc = 'pancakeswap_usdc'#

Two or three-legged trades on PancakeSwap.

  • Open positions with USDC quote token.

  • Open positions with WBNB quote token.

pancakeswap_usdt = 'pancakeswap_usdt'#

Two or three legged trades on Pancake on BSC

  • Open positions with USDT quote token.

  • Open positions with WBNB quote token.

quickswap_usdc = 'quickswap_usdc'#

Two or three legged trades on Quickswap on Polygon

  • Open positions with USDC quote token.

  • Open positions with WMATIC quote token.

quickswap_usdt = 'quickswap_usdt'#

Two or three legged trades on Quickswap on Polygon

  • Open positions with USDT quote token.

  • Open positions with WMATIC quote token.

quickswap_dai = 'quickswap_dai'#

Two or three legged trades on Quickswap on Polygon

  • Open positions with DAI quote token.

  • Open positions with USDC quote token.

trader_joe_usdc = 'trader_joe_usdc'#

Two or three legged trades on Trader Joe on Avalanche

  • Open positions with USDC quote token.

  • Open positions with WAVAX quote token.

trader_joe_usdt = 'trader_joe_usdt'#

Two or three legged trades on Trader Joe on Avalanche

  • Open positions with USDT quote token.

  • Open positions with WAVAX quote token.

sushi_usdc = 'sushi_usdc'#

Two or three legged trades on Sushiswap on Ethereum mainnet

  • Open positions with USDC quote token.

  • Open positions with WETH quote token.

sushi_usdt = 'sushi_usdt'#

Two or three legged trades on Sushiswap on Ethereum mainnet

  • Open positions with USDT quote token.

  • Open positions with WETH quote token.

uniswap_v2_usdc = 'uniswap_v2_usdc'#

Two or three legged trades on Uniswap v2 on Ethereum mainnet

  • Open positions with USDC quote token.

  • Open positions with WETH quote token.

uniswap_v2_usdt = 'uniswap_v2_usdt'#

Two or three legged trades on Uniswap V2 on Ethereum

  • Open positions with USDT quote token.

  • Open positions with WETH quote token.

uniswap_v2_dai = 'uniswap_v2_dai'#

Two or three legged trades on Uniswap V2 on Ethereum

  • Open positions with DAI quote token.

  • Open positions with WETH quote token.

uniswap_v3_usdc = 'uniswap_v3_usdc'#

Two or three legged trades on Uniswap v3 on Ethereum mainnet

  • Open positions with USDC quote token.

  • Open positions with WETH quote token.

uniswap_v3_usdt = 'uniswap_v3_usdt'#

Two or three legged trades on Uniswap v3 on Ethereum mainnet

  • Open positions with USDT quote token.

  • Open positions with WETH quote token.

uniswap_v3_dai = 'uniswap_v3_dai'#

Two or three legged trades on Uniswap v3 on Ethereum mainnet

  • Open positions with DAI quote token.

  • Open positions with WETH quote token.

uniswap_v3_busd = 'uniswap_v3_busd'#

Two or three legged trades on Uniswap v3 on Ethereum mainnet

  • Open positions with BUSD quote token.

  • Open positions with USDC quote token.

  • Open positions with USDT quote token.

  • Open positions with DAI quote token.

uniswap_v3_usdc_poly = 'uniswap_v3_usdc_poly'#

Two or three legged trades on Uniswap v3 on Polygon mainnet

  • Open positions with USDC quote token.

  • Open positions with WETH quote token.

uniswap_v3_usdt_poly = 'uniswap_v3_usdt_poly'#

Two or three legged trades on Uniswap v3 on Polygon mainnet

  • Open positions with USDT quote token.

  • Open positions with WETH quote token.

  • Open positions with USDC quote token.

uniswap_v3_usdc_arbitrum_bridged = 'uniswap_v3_usdc_arbitrum_bridged'#

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

uniswap_v3_usdc_arbitrum_native = 'uniswap_v3_usdc_arbitrum_native'#

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

uniswap_v3_usdt_arbitrum = 'uniswap_v3_usdt_arbitrum'#

Two or three legged trades on Uniswap v3 on Arbitrum mainnet

  • Open positions with USDT quote token.

  • Open positions with WETH quote token.

one_delta_polygon_usdc = 'one_delta_polygon_usdc'#

Two legged trades on 1delta on Polygon mainnet

  • Open positions with USDC quote token.

user_supplied_routing_model = 'user_supplied_routing_model'#

Use user supplied routing model

The routing table is constructed by the developer in the Python code.

Mostly useful for unit testing.

ignore = 'ignore'#

Backtesting only

The order routing is ignored. We use backtest estimations for trading fees and assume all pairs are tradeable.

default = 'default'#

Use any generic USDC routing

  • Support Uniswap v2, Uniswap v3, Aave and 1delta based on the default configurations

  • Use USDC as a reserve currency

is_uniswap_v2()[source]#

Do we need Uniswap v2 routing model

Return type:

bool

is_uniswap_v3()[source]#

Do we need Uniswap v3 routing model

Return type:

bool

is_one_delta()[source]#

Do we need 1delta routing model

Return type:

bool