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)#
Parameters:
Return type:

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

opening_amount

How many tokens we deposited to this position at amount.

last_atoken_amount

How many atokens/votkens we had on the previous read.

last_updated_at

When the denormalised data was last updated.

last_event_at

When the denormalised data was last updated.

last_accrued_interest

How much interest we have gained

last_updated_block_number

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_updated_at: datetime#

When the denormalised data was last updated.

Wall clock time.

last_event_at: datetime#

When the denormalised data was last updated.

Event time (block mined timestamp).

last_accrued_interest: Decimal#

How much interest we have gained

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)#
Parameters:
Return type:

None