AssetToPositionsMapping#
API documentation for tradeexecutor.strategy.asset.AssetToPositionsMapping Python class in Trading Strategy framework.
- class AssetToPositionsMapping[source]#
Bases:
object
Tell us which positions hold the asset in a portfolio.
- __init__(asset, positions=<factory>, quantity=Decimal('0'))#
- Parameters:
asset (AssetIdentifier) –
positions (Set[GenericPosition]) –
quantity (Decimal) –
- Return type:
None
Methods
__init__
(asset[, positions, quantity])get_first_position
()get_only_position
()is_for_reserve
()is_one_to_one_asset_to_position
()Attributes
Expected amount of tokens we will find on chain
Token we are checking
Positions using this token
- asset: AssetIdentifier#
Token we are checking
- positions: Set[GenericPosition]#
Positions using this token
- quantity: Decimal = Decimal('0')#
Expected amount of tokens we will find on chain
This is the quantity across all positions.
- __init__(asset, positions=<factory>, quantity=Decimal('0'))#
- Parameters:
asset (AssetIdentifier) –
positions (Set[GenericPosition]) –
quantity (Decimal) –
- Return type:
None