update_leveraged_position_interest#
API documentation for tradeexecutor.strategy.interest.update_leveraged_position_interest Python function.
- update_leveraged_position_interest(state, position, new_vtoken_amount, new_token_amount, event_at, vtoken_price, atoken_price=1.0, block_number=None, tx_hash=None, log_index=None, max_interest_gain=0.05)[source]#
Updates accrued interest on lending protocol leveraged positions.
Updates loan interest state for both collateral and debt.
- Parameters:
atoken_price (float) –
What is the current price of aToken.
Needed to calculate dollar nominated amounts.
vtoken_price (float) –
What is the current price of vToken
Needed to calculate dollar nominated amounts.
state (State) –
position (TradingPosition) –
new_vtoken_amount (Decimal) –
new_token_amount (Decimal) –
event_at (datetime) –
block_number (int | None) –
tx_hash (int | None) –
log_index (int | None) –
max_interest_gain (float) –
- Returns:
Tuple (vToken update event, aToken update event)
- Return type: