Skip to main content
Rust CPI integrations should prefer the generated stake_for_fee_interface invoke helpers over hand-built discriminators. The helpers expose both *_invoke and *_invoke_signed variants for every instruction.
Stake2Earn instructions use Anchor Event CPI. CPI callers must include the generated event_authority account and the Stake2Earn program account where the generated key structs require them.

CPI Helper Families

Initialize Vault CPI

initialize_vault creates the Stake2Earn vault and two list accounts.

Stake And Claim CPI

stake and claim_fee are not isolated stake-account mutations. They first claim and distribute pending DAMM v1 lock escrow fees, so callers must include the full DAMM v1 and Dynamic Vault account bundle. Top-list synchronization may require additional stake escrow accounts in remaining_accounts. If the full balance list index must be reclaimed, pass the expected smallest_stake_escrow.

Unstake CPI

Vault PDA Signer Seeds

When the Stake2Earn program signs for its token vaults internally, it uses: External CPI callers do not sign as the Stake2Earn vault PDA unless they are invoking another program directly. If your program composes DAMM v1 lock escrow setup before calling Stake2Earn, ensure the lock escrow owner is the Stake2Earn vault PDA.

Crank And Admin CPI

CPI Gotchas