ReservePosition#
tradeexecutor.state.reserve.ReservePosition Python class in Trading Strategy framework.
- 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)#
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
What was the first deposit amount.
What was the first deposit exchange rate.
What is our reserve currency
How much reserves we have currently
When we processed deposits/withdraws last time
What was the US dollar exchange rate of our reserves
When we fetched the US dollar exchange rate of our reserves last time
- asset: AssetIdentifier#
What is our reserve currency
- 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[float] = 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)#