#[repr(C)]pub enum SinglePoolInstruction {
InitializePool,
ReplenishPool,
DepositStake,
WithdrawStake {
user_stake_authority: Pubkey,
token_amount: u64,
},
CreateTokenMetadata,
UpdateTokenMetadata {
name: String,
symbol: String,
uri: String,
},
InitializePoolOnRamp,
}Expand description
Instructions supported by the SinglePool program.
Variants§
InitializePool
Initialize the mint and main stake account for a new single-validator
stake pool. The pool stake account must contain the rent-exempt
minimum plus the minimum balance of 1 sol. No tokens will be minted;
to deposit more, use Deposit after InitializeStake.
[]Validator vote account[w]Pool account[w]Pool stake account[w]Pool token mint[]Pool stake authority[]Pool mint authority[]Rent sysvar[]Clock sysvar[]Stake history sysvar[]Stake config sysvar[]System program[]Token program[]Stake program
ReplenishPool
Bring the pool stake accounts to their optimal state. This performs several operations:
- If the main stake account has been deactivated by
DeactivateDelinquent, reactivate it. - Then, if the main stake account is already fully active:
- If the on-ramp is fully active, move its stake to the main account.
- If the main account has excess lamports, move them to the on-ramp.
- Delegate the on-ramp if it has excess lamports to activate.
Combined, these operations allow harvesting and delegating MEV rewards and will eventually allow depositing liquid sol for pool tokens.
This instruction is idempotent and gracefully skips operations that would fail or have no effect, up to no-op. This allows it to be executed speculatively or as part of arbitrary flows involving the pool. If the on-ramp account is already activating, and there are excess lamports beyond the activating delegation, it increases the delegation to include them.
This instruction will fail with an error if the on-ramp account does not
exist. If the pool does not have the account, InitializePoolOnRamp must
be called to create it.
[]Validator vote account[]Pool account[w]Pool stake account[w]Pool on-ramp account[]Pool stake authority[]Clock sysvar[]Stake history sysvar[]Stake config sysvar[]Stake program
DepositStake
Deposit stake into the pool. The output is a “pool” token representing fractional ownership of the pool stake. Inputs are converted to the current ratio.
[]Pool account[w]Pool stake account[]Pool on-ramp account (not yet enforced)[w]Pool token mint[]Pool stake authority[]Pool mint authority[w]User stake account to join to the pool[w]User account to receive pool tokens[w]User account to receive lamports[]Clock sysvar[]Stake history sysvar[]Token program[]Stake program
WithdrawStake
Redeem tokens issued by this pool for stake at the current ratio.
[]Pool account[w]Pool stake account[]Pool on-ramp account (not yet enforced)[w]Pool token mint[]Pool stake authority[]Pool mint authority[w]User stake account to receive stake at[w]User account to take pool tokens from[]Clock sysvar[]Token program[]Stake program
Fields
User authority for the new stake account
CreateTokenMetadata
Create token metadata for the stake-pool token in the metaplex-token program. Step three of the permissionless three-stage initialization flow. Note this instruction is not necessary for the pool to operate, to ensure we cannot be broken by upstream.
[]Pool account[]Pool token mint[]Pool mint authority[]Pool MPL authority[s, w]Payer for creation of token metadata account[w]Token metadata account[]Metadata program id[]System program id
UpdateTokenMetadata
Update token metadata for the stake-pool token in the metaplex-token program.
[]Validator vote account[]Pool account[]Pool MPL authority[s]Vote account authorized withdrawer[w]Token metadata account[]Metadata program id
Fields
InitializePoolOnRamp
Create the on-ramp account for a single-validator stake pool, which is used to delegate liquid sol so that it can be merged into the main pool account as active stake.
New pools created with initialize() will include this instruction
automatically. Existing pools must use InitializePoolOnRamp to upgrade to
the latest version.
This is a temporary instruction that will be deprecated some time after all
existing pools have upgraded. Its logic is intended to be incorporated
into InitializePool itself.
[]Pool account[w]Pool on-ramp account[]Pool stake authority[]Rent sysvar[]System program[]Stake program
Trait Implementations§
Source§impl BorshDeserialize for SinglePoolInstruction
impl BorshDeserialize for SinglePoolInstruction
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl Clone for SinglePoolInstruction
impl Clone for SinglePoolInstruction
Source§fn clone(&self) -> SinglePoolInstruction
fn clone(&self) -> SinglePoolInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more