interest#

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

Module description#

Functions to refresh accrued interest on credit positions.

Functions#

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.

record_interest_rate(state, universe, timestamp)

Record interest rate at the time opening position.

set_interest_checkpoint(state, timestamp, ...)

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

sync_interests(*, web3, wallet_address, ...)

Update position's interests on all tokens that receive interests

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

Poke leverage position to increase its interest amount.

update_leveraged_position_interest(state, ...)

Updates accrued interest on lending protocol leveraged positions.