pub fn update_position_balance(
    ctx: Context<'_, '_, '_, '_, UpdatePositionBalance<'_>>
) -> Result<()>
Expand description

Update the balance of a position stored in the margin account to match the actual stored by the SPL token account.

When a user deposits tokens directly (without invoking this program), there’s no update within the user’s margin account to account for the new token balance. This instruction allows udating the margin account state to reflect the current available balance of collateral.

Accounts

NameTypeDescription
margin_accountwritableThe margin account to update.
token_accountread_onlyThe token account to update the balance for.

Events

Event NameDescription
events::PositionBalanceUpdatedMarks the updating of the position balance.