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:
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

quantity

Expected amount of tokens we will find on chain

asset

Token we are checking

positions

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

None