ReservePosition#

tradeexecutor.state.reserve.ReservePosition class.

class ReservePosition[source]#

Bases: object

Manage reserve currency of a portfolio.

  • One portfolio can have multiple reserve currencies, but currently the code is simplified to handle only one reserve currency

__init__(asset, quantity, last_sync_at, reserve_token_price, last_pricing_at, initial_deposit=None, initial_deposit_reserve_token_price=None)#
Parameters
Return type

None

Methods

__init__(asset, quantity, last_sync_at, ...)

from_dict(kvs, *[, infer_missing])

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

get_current_value()

get_identifier()

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

to_dict([encode_json])

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

Attributes

initial_deposit

What was the first deposit amount.

initial_deposit_reserve_token_price

What was the first deposit exchange rate.

asset

What is our reserve currency

quantity

How much reserves we have currently

last_sync_at

When we processed deposits/withdraws last time

reserve_token_price

What was the US dollar exchange rate of our reserves

last_pricing_at

When we fetched the US dollar exchange rate of our reserves last time

asset: AssetIdentifier#

What is our reserve currency

quantity: Decimal#

How much reserves we have currently

last_sync_at: datetime#

When we processed deposits/withdraws last time

reserve_token_price: USDollarAmount#

What was the US dollar exchange rate of our reserves

last_pricing_at: datetime#

When we fetched the US dollar exchange rate of our reserves last time

initial_deposit: Optional[Decimal] = None#

What was the first deposit amount. Used to shortcut the backtest performance benchmark. TODO: Remove optional in future versions.

initial_deposit_reserve_token_price: Optional[USDollarAmount] = None#

What was the first deposit exchange rate. Used to shortcut the backtest performance benchmark. TODO: Remove optional in future versions.

__init__(asset, quantity, last_sync_at, reserve_token_price, last_pricing_at, initial_deposit=None, initial_deposit_reserve_token_price=None)#
Parameters
Return type

None