InterestDistributionEntry#

API documentation for tradeexecutor.state.interest_distribution.InterestDistributionEntry Python class in Trading Strategy framework.

class InterestDistributionEntry[source]#

Bases: object

Map interest distribution across different trading positions.

A helper class to help us to distribute accrued interest across different related trading positions.

The lifetime of an instance is one sync_interests() run.

__init__(side, position, tracker, weight=None, price=None)#
Parameters:
Return type:

None

Methods

__init__(side, position, tracker[, weight, ...])

from_dict(kvs, *[, infer_missing])

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

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

to_dict([encode_json])

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

Attributes

side

Which side we are on

position

The trading position containing this asset

tracker

Can be either loan.collateral or loan.borrower

weight

All weight are normalised to 0...1 based on loan token amount.

price

The updated price for the tracked asset

asset

Amount of tracked asset in tokens

quantity

Amount of tracked asset in tokens

side: LoanSide#

Which side we are on

position: TradingPosition#

The trading position containing this asset

tracker: AssetWithTrackedValue#

Can be either loan.collateral or loan.borrower

This is a pass-by-reference copy from Loan instance

weight: Decimal#

All weight are normalised to 0…1 based on loan token amount.

price: float#

The updated price for the tracked asset

To update US dollar based prices of interests, we need to know any change in the asset prices.

property asset: AssetIdentifier#

Amount of tracked asset in tokens

property quantity: Decimal#

Amount of tracked asset in tokens

__init__(side, position, tracker, weight=None, price=None)#
Parameters:
Return type:

None