API documentation for tradeexecutor.strategy.interest Python module in Trading Strategy.

Module description#

Functions to refresh accrued interest on credit positions.


accrue_interest(state, on_chain_balances, ...)

Update the internal ledger to match interest accrued on on-chain balances.

distribute_interest_for_assets(operation, ...)

Distribute the accrued interest of an asset across all positions holding this asset.

distribute_to_entry(entry, state, timestamp, ...)

Update interest one position, one side of loan.

estimate_interest(start_at, end_at, ...[, year])

Calculate new token amount, assuming fixed interest.

prepare_interest_distribution(start, end, ...)

Get all tokens in open positions that accrue interest.

set_interest_checkpoint(state, timestamp, ...)

Set the last updated at flag for rebase interest calcualtions at the internal state.

update_interest(state, position, asset, ...)

Poke credit supply position to increase its interest amount.

update_leveraged_position_interest(state, ...)

Updates accrued interest on lending protocol leveraged positions.