AssetIdentifier#
API documentation for tradeexecutor.state.identifier.AssetIdentifier Python class in Trading Strategy framework.
- class AssetIdentifier[source]#
Bases:
object
Identify a blockchain asset for trade execution.
As internal token_ids and pair_ids may be unstable, trading pairs and tokens are explicitly referred by their smart contract addresses when a strategy decision moves to the execution. We duplicate data here to make sure we have a persistent record that helps to diagnose the sisues.
- __init__(chain_id, address, token_symbol, decimals, internal_id=None, info_url=None, underlying=None, type=None, liquidation_threshold=None)#
Methods
__init__
(chain_id, address, token_symbol, ...)convert_to_decimal
(raw_amount)convert_to_raw_amount
(amount)Return any amount in token native units.
from_dict
(kvs, *[, infer_missing])from_json
(s, *[, parse_float, parse_int, ...])Assets are identified by their smart contract address.
Do we think this asset reprents a stablecoin
schema
(*[, infer_missing, only, exclude, ...])to_dict
([encode_json])to_json
(*[, skipkeys, ensure_ascii, ...])Attributes
Ethereum madness.
Info page URL for this asset
How this asset is referred in the internal database
Aave liquidation threhold for this asset
What kind of asset is this
The underlying asset for aTokens, vTokens and such
Smart contract address of the asset.
The ticker symbol of this token.
How many tokens this decimals.
- underlying: Optional[AssetIdentifier] = None#
The underlying asset for aTokens, vTokens and such
- type: tradeexecutor.state.identifier.AssetType | None = None#
What kind of asset is this
Legacy data will default to
None
.
- liquidation_threshold: float | None = None#
Aave liquidation threhold for this asset
Set on aTokens that are used as collateral.
- property checksum_address: HexAddress#
Ethereum madness.
- convert_to_raw_amount(amount)[source]#
Return any amount in token native units.
Convert decimal to fixed point integer.
- __init__(chain_id, address, token_symbol, decimals, internal_id=None, info_url=None, underlying=None, type=None, liquidation_threshold=None)#