get_base_quote#

API documentation for tradeexecutor.ethereum.routing_state.get_base_quote Python function.

get_base_quote(web3, target_pair, reserve_asset, error_msg=None)[source]#

Get base and quote token from the pair and reserve asset. Called in parent class (RoutingState) with error_msg.

See: https://tradingstrategy.ai/docs/programming/market-data/trading-pairs.html

Parameters:
  • target_pair (TradingPairIdentifier) – Pair to be traded

  • reserver_asset – Asset to be kept as reserves

  • error_msg (Optional[str]) – Only provide this argument if error message includes external info such as an intermediary pair

  • web3 (Web3) –

  • reserve_asset (AssetIdentifier) –

Returns:

(base_token: Contract, quote_token: Contract)