pub fn create_account(
    ctx: Context<'_, '_, '_, '_, CreateAccount<'_>>,
    seed: u16
) -> Result<()>
Expand description

Create a new margin account for a user

Parameters

  • seed - An abritrary integer used to derive the new account address. This allows a user to own multiple margin accounts, by creating new accounts with different seed values.

Accounts

NameTypeDescription
ownersignerThe owner of the new margin account.
payersignerThe pubkey paying rent for the new margin account opening.
margin_accountwritableThe margin account to initialize for the owner.
system_programread_onlyThe system native program.

Events

Event NameDescription
events::AccountCreatedMarks the creation of the account.