#[repr(C)]
#[repr(align(8))]
pub struct MarginAccount { pub version: u8, pub bump_seed: [u8; 1], pub user_seed: [u8; 2], pub invocation: Invocation, pub reserved0: [u8; 3], pub owner: Pubkey, pub liquidation: Pubkey, pub liquidator: Pubkey, pub positions: [u8; 7432], }

Fields

version: u8bump_seed: [u8; 1]user_seed: [u8; 2]invocation: Invocation

Data an adapter can use to check what the margin program thinks about the current invocation Must normally be zeroed, except during an invocation.

reserved0: [u8; 3]owner: Pubkey

The owner of this account, which generally has to sign for any changes to it

liquidation: Pubkey

The state of an active liquidation for this account

liquidator: Pubkey

The active liquidator for this account

positions: [u8; 7432]

The storage for tracking account balances

Implementations

Get the list of positions on this account

Register the space for a new position into this account

Free the space from a previously registered position no longer needed

faster than searching by mint only if you have the correct key slightly slower if you have the wrong key

faster than searching by mint only if you have the correct key slightly slower if you have the wrong key

Change the balance for a position

Change the current price value of a position

Check that the overall health of the account is acceptable, by comparing the total value of the claims versus the available collateral. If the collateralization ratio is above the minimum, then the account is considered healthy.

Check that the overall health of the account is not acceptable.

Check if the given address is the current authority for this margin account

Trait Implementations

Deserializes previously initialized account data. Should fail for all uninitialized accounts, where the bytes are zeroed. Implementations should be unique to a particular account type so that one can never successfully deserialize the data of one account type into another. For example, if the SPL token program were to implement this trait, it should be impossible to deserialize a Mint account into a token Account. Read more
Deserializes account data without checking the account discriminator. This should only be used on account initialization, when the bytes of the account are zeroed. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern. Read more
If this function returns true, then it must be valid to reinterpret bits as &Self. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.