Interest#
API documentation for tradeexecutor.state.interest.Interest Python class in Trading Strategy framework.
- class Interest[source]#
Bases:
object
Interest data tracking for positions that where the amount changes over time.
Credit positions (depositing in Aave reservess)
Longs / shorts
- __init__(opening_amount, last_atoken_amount, last_updated_at, last_event_at, last_accrued_interest, last_updated_block_number=None)#
Methods
__init__
(opening_amount, last_atoken_amount, ...)from_dict
(kvs, *[, infer_missing])from_json
(s, *[, parse_float, parse_int, ...])open_new
(opening_amount)schema
(*[, infer_missing, only, exclude, ...])to_dict
([encode_json])to_json
(*[, skipkeys, ensure_ascii, ...])Attributes
How many tokens we deposited to this position at amount.
How many atokens/votkens we had on the previous read.
When the denormalised data was last updated.
When the denormalised data was last updated.
How much interest we have gained
Block number for the update
- opening_amount: Decimal#
How many tokens we deposited to this position at amount.
Use this only for calculation verifications, because the amount can be increased/reduced over time
- last_atoken_amount: Decimal#
How many atokens/votkens we had on the previous read.
This is principal + interest.
- last_event_at: datetime#
When the denormalised data was last updated.
Event time (block mined timestamp).
- last_updated_block_number: int | None#
Block number for the update
When was the last time we read aToken balance.
- __init__(opening_amount, last_atoken_amount, last_updated_at, last_event_at, last_accrued_interest, last_updated_block_number=None)#