Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

Stake2Earn is Meteora’s stake-for-fee program for DAMM v1 constant-product pools. Pool creators lock DAMM v1 LP into a program-owned lock escrow, and token holders stake the pool’s base token to compete for the top staker list that receives released LP fees. To learn the product flow, configuration limits, and formulas before integrating, read the product documentation.

What Is Stake2Earn

Product overview for Stake2Earn staking, LP fee delegation, and top staker rewards.

Configuration And Limits

Product-level settings and launch constraints for Stake2Earn vaults.

Stake2Earn Formulas

Product formulas for staking, fees, and reward distribution.
Stake2Earn only supports DAMM v1 constant-product pools where the quote mint is SOL or USDC and the stake mint is the non-quote pool token.

Integration

Program Accounts

PDA seeds, vault state, stake escrow state, unstake requests, and top/full balance list layouts.

Program Instructions

Vault creation, staking, claiming, unstaking, withdrawal, crank, and admin instruction details.

Program Events

Event CPI emissions for vault lifecycle, staking, fee release, top list movement, and admin updates.

Program Errors

Anchor custom error codes, enum names, messages, and common integration causes.

TypeScript SDK

Transaction builders, state readers, PDA helpers, and examples from @meteora-ag/m3m3.

Rust Integration

Generated Rust instruction/account interface, PDA helpers, and CPI guidance.

Stake2Earn API

Indexed read-only vault discovery, analytics, filter routes, and leaderboard responses.

Changelog

Program, SDK, API, and source-noted release changes that affect integrations.

Program IDs

The public stake_for_fee program ID is the same on mainnet and devnet:
NetworkProgram ID
Mainnet BetaFEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP
DevnetFEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP
Local feature buildM5c95Zio3HQ1gvQ3pjhh8BsscrDcKnN28gxnQD1E17U
Related program IDs used by the SDK:
ProgramID
DAMM v1Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB
Dynamic Vault24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi

Stake2Earn Program

Anchor program source for stake_for_fee.

Stake2Earn IDL

TypeScript IDL bundled by the public SDK.

TypeScript SDK

@meteora-ag/m3m3 SDK source for transaction builders and state helpers.

Rust Interface

Generated Rust instruction, account, event, and error interface.

Important Constants

ConstantPublic valueUse
MIN_LIST_LENGTH / MAX_LIST_LENGTH5 / 1000Allowed top staker list length on public builds.
FULL_BALANCE_LIST_HARD_LIMIT10000Maximum tracked full-balance entries on public builds.
MIN_SECONDS_TO_FULL_UNLOCK / MAX_SECONDS_TO_FULL_UNLOCK6 hours / 31 daysAllowed fee drip duration range.
MIN_UNSTAKE_LOCK_DURATION / MAX_UNSTAKE_LOCK_DURATION6 hours / 31 daysAllowed unstake cooldown range.
MAX_JOIN_WINDOW_DURATION31 daysMaximum delay before fee distribution begins.
MIN_LOCK_ESCROW_CLAIM_FEE_DURATION5 minutesMinimum interval before another lock escrow fee claim.
SCALE_OFFSET64Fixed-point scale used for cumulative fee-per-liquidity checkpoints.
Quote mintsSOL, USDCOnly SOL and USDC are accepted as quote mints.

Commands

TaskCommand
Build TypeScript SDKcd stake-for-fee-sdk/ts-client && pnpm install && pnpm run build
Run TypeScript SDK testscd stake-for-fee-sdk/ts-client && pnpm test
Build local programcd stake-for-fee && anchor build -p stake_for_fee -- --features local
Run local program testscd stake-for-fee && yarn test
Check Rust interface workspacecd stake-for-fee-sdk && cargo check