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

Close a user’s margin account

The margin account must have zero positions remaining to be closed.

Accounts

NameTypeDescription
ownersignerThe owner of the account being closed.
receiverwritableThe account to get any returned rent.
margin_accountwritableThe account being closed.

Events

Event NameDescription
events::AccountClosedMarks the closure of the account.