TradingPairIdentifier#
tradeexecutor.state.identifier.TradingPairIdentifier class.
- class TradingPairIdentifier[source]#
Bases:
object
TradingPairIdentifier(base: tradeexecutor.state.identifier.AssetIdentifier, quote: tradeexecutor.state.identifier.AssetIdentifier, pool_address: str, exchange_address: str, internal_id: Optional[int] = None, internal_exchange_id: Optional[int] = None, info_url: Optional[str] = None)
- __init__(base, quote, pool_address, exchange_address, internal_id=None, internal_exchange_id=None, info_url=None)#
- Parameters
base (AssetIdentifier) –
quote (AssetIdentifier) –
pool_address (str) –
exchange_address (str) –
- Return type
None
Methods
__init__
(base, quote, pool_address, ...[, ...])from_dict
(kvs, *[, infer_missing])from_json
(s, *[, parse_float, parse_int, ...])get_human_description
()We use the smart contract pool address to uniquely identify trading positions.
Check if the pair has good information.
schema
(*[, infer_missing, only, exclude, ...])to_dict
([encode_json])to_json
(*[, skipkeys, ensure_ascii, ...])Attributes
Info page URL for this trading pair e.g.
What is the internal exchange id of this trading pair.
How this asset is referred in the internal database
base
quote
Smart contract address of the pool contract.
Exchange address.
- exchange_address: str#
Exchange address. Identifies a decentralised exchange. Uniswap v2 likes are identified by their factor address.
- get_identifier()[source]#
We use the smart contract pool address to uniquely identify trading positions.
Ethereum address is lowercased, not checksummed.
- Return type
- has_complete_info()[source]#
Check if the pair has good information.
Both base and quote token must have
Symbol
Decimals
This check is mainly useful to filter out crap tokens from the trading decisions.
- Return type
- __init__(base, quote, pool_address, exchange_address, internal_id=None, internal_exchange_id=None, info_url=None)#
- Parameters
base (AssetIdentifier) –
quote (AssetIdentifier) –
pool_address (str) –
exchange_address (str) –
- Return type
None