Function jet_margin::jet_margin::update_position_balance
source · [−]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
Name | Type | Description |
margin_account | writable | The margin account to update. |
token_account | read_only | The token account to update the balance for. |
Events
Event Name | Description |
events::PositionBalanceUpdated | Marks the updating of the position balance. |