pub struct PersonalPositionInitAccounts<'info> {
pub payer: AccountInfo<'info>,
pub owner: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
pub personal_position: AccountInfo<'info>,
pub escrow: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}Expand description
Initialize a personal position account for market interaction.
Creates a user-specific account that tracks collateral deposits and debt obligations for a particular market. Required before performing borrow operations or using collateral-based features.
§Position Features
Personal positions enable:
- Collateral deposits (market tokens as collateral)
- Borrowing against collateral (up to LTV limits)
- Tracking debt obligations and interest
- Liquidation protection through collateralization
§Account Structure
- Unique per user per market
- Stores collateral and debt balances
- Tracks last update timestamp for interest
- Immutable market and owner references
§One-Time Setup
Each user needs only one position per market. Attempting to create a duplicate will fail. The position persists until explicitly closed.
Fields§
§payer: AccountInfo<'info>Account paying for the personal position and escrow account creation.
owner: AccountInfo<'info>The owner who will control the personal position.
market_meta: AccountInfo<'info>Market metadata identifying which market this position belongs to.
mint_token: AccountInfo<'info>Mint for the market tokens that can be deposited as collateral.
personal_position: AccountInfo<'info>The new personal position account being initialized.
escrow: AccountInfo<'info>Escrow token account for holding collateral tokens.
token_program: AccountInfo<'info>Token program for creating the escrow account.
system_program: AccountInfo<'info>System program for creating new accounts.
log_account: AccountInfo<'info>§mayflower_program: AccountInfo<'info>Trait Implementations§
Source§impl<'info> Accounts<'info, PersonalPositionInitAccountsBumps> for PersonalPositionInitAccounts<'info>where
'info: 'info,
impl<'info> Accounts<'info, PersonalPositionInitAccountsBumps> for PersonalPositionInitAccounts<'info>where
'info: 'info,
Source§fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut PersonalPositionInitAccountsBumps,
__reallocs: &mut BTreeSet<Pubkey>,
) -> Result<Self>
fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut PersonalPositionInitAccountsBumps, __reallocs: &mut BTreeSet<Pubkey>, ) -> Result<Self>
Mint account from the SPL token program in a particular
field, then it should be impossible for this method to return Ok if
any other account type is given–from the SPL token program or elsewhere. Read moreSource§impl<'info> AccountsExit<'info> for PersonalPositionInitAccounts<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for PersonalPositionInitAccounts<'info>where
'info: 'info,
Source§impl<'info> Bumps for PersonalPositionInitAccounts<'info>where
'info: 'info,
impl<'info> Bumps for PersonalPositionInitAccounts<'info>where
'info: 'info,
Source§type Bumps = PersonalPositionInitAccountsBumps
type Bumps = PersonalPositionInitAccountsBumps
Source§impl<'info> ToAccountInfos<'info> for PersonalPositionInitAccounts<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for PersonalPositionInitAccounts<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
Source§impl<'info> ToAccountMetas for PersonalPositionInitAccounts<'info>
impl<'info> ToAccountMetas for PersonalPositionInitAccounts<'info>
Source§fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
is_signer is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client.Auto Trait Implementations§
impl<'info> Freeze for PersonalPositionInitAccounts<'info>
impl<'info> !RefUnwindSafe for PersonalPositionInitAccounts<'info>
impl<'info> !Send for PersonalPositionInitAccounts<'info>
impl<'info> !Sync for PersonalPositionInitAccounts<'info>
impl<'info> Unpin for PersonalPositionInitAccounts<'info>
impl<'info> !UnwindSafe for PersonalPositionInitAccounts<'info>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more