generate_pair_for_binance#

API documentation for tradingstrategy.binance.utils.generate_pair_for_binance Python function.

generate_pair_for_binance(symbol, fee=0.0005, base_token_decimals=18, quote_token_decimals=18)[source]#

Generate a trading pair identifier for Binance data.

Binance data is not on-chain, so we need to generate the identifiers for the trading pairs.

Note

Internal exchange id is hardcoded to 129875571 and internal id to 134093847

Parameters:
  • symbol (str) – E.g. ETHUSDT

  • fee (float) – fee for the pair in float form

  • base_token_decimals (int) – decimals for the base token

  • quote_token_decimals (int) – decimals for the quote token

Returns:

Trading pair identifier

Return type:

DEXPair