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
Return type

None

Methods

__init__(base, quote, pool_address, ...[, ...])

from_dict(kvs, *[, infer_missing])

from_json(s, *[, parse_float, parse_int, ...])

get_human_description()

get_identifier()

We use the smart contract pool address to uniquely identify trading positions.

has_complete_info()

Check if the pair has good information.

schema(*[, infer_missing, only, exclude, ...])

to_dict([encode_json])

to_json(*[, skipkeys, ensure_ascii, ...])

Attributes

info_url

Info page URL for this trading pair e.g.

internal_exchange_id

What is the internal exchange id of this trading pair.

internal_id

How this asset is referred in the internal database

base

quote

pool_address

Smart contract address of the pool contract.

exchange_address

Exchange address.

pool_address: str#

Smart contract address of the pool contract.

exchange_address: str#

Exchange address. Identifies a decentralised exchange. Uniswap v2 likes are identified by their factor address.

internal_id: Optional[int] = None#

How this asset is referred in the internal database

internal_exchange_id: Optional[int] = None#

What is the internal exchange id of this trading pair.

info_url: Optional[str] = None#

Info page URL for this trading pair e.g. with the price charts

get_identifier()[source]#

We use the smart contract pool address to uniquely identify trading positions.

Ethereum address is lowercased, not checksummed.

Return type

str

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

bool

__init__(base, quote, pool_address, exchange_address, internal_id=None, internal_exchange_id=None, info_url=None)#
Parameters
Return type

None