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.

This page summarizes the account model used by stake_for_fee. For exact binary layouts, use the Anchor IDL or the generated TypeScript and Rust types exported by @meteora-ag/m3m3 and stake_for_fee_interface.

PDA Map

AccountSeedsNotes
FeeVault["vault", pool]One Stake2Earn vault per DAMM v1 pool.
TopListMetadata["list", vault]Header plus appended StakerMetadata entries for top stakers.
FullBalanceListMetadata["balance", vault]Header plus appended StakerBalance entries for tracked stakers.
StakeEscrow["escrow", vault, owner]User stake account for one vault and owner.
DAMM v1 LockEscrow["lock_escrow", pool, vault] in the DAMM v1 programHolds locked LP for the Stake2Earn vault owner PDA.
Event authority["__event_authority"]Anchor Event CPI authority used by generated clients.
The SDK exports deriveFeeVault, deriveTopStakerList, deriveFullBalanceList, deriveStakeEscrow, deriveLockEscrowPda, and deriveLpMint.

FeeVault

FeeVault is the root Stake2Earn account.
FieldMeaning
lock_escrowDAMM v1 lock escrow whose owner is the Stake2Earn vault PDA.
stake_mintPool token that users stake. Must not be SOL or USDC.
quote_mintQuote mint. Public builds accept SOL or USDC.
poolDAMM v1 constant-product pool linked to the vault.
stake_token_vaultToken account owned by the vault PDA for staked base tokens.
quote_token_vaultToken account owned by the vault PDA for quote fee claims.
top_staker_listPDA storing top staker entries.
full_balance_listPDA storing tracked staker balances.
metricsAggregate stake, escrow count, ongoing unstake, and fee totals.
configurationFee drip and unstake configuration.
top_staker_infoTop list size, effective stake, locked fees, and fee-per-liquidity checkpoints.
creatorCreator that initialized the vault.
created_atUnix timestamp when the vault was initialized.
bumpPDA bump for vault signing.

Configuration

FieldMeaning
seconds_to_full_unlockTime required for locked claimed fees to drip fully to top stakers.
unstake_lock_durationCooldown before a requested unstake can be withdrawn.
start_fee_distribute_timestampTimestamp when fee distribution begins. Defaults to vault creation time when not provided.

Metrics

FieldMeaning
total_staked_amountTotal active staked amount across stake escrows.
total_stake_escrow_countNumber of stake escrows initialized for the vault.
ongoing_total_partial_unstake_amountStake amount currently locked in pending unstake requests.
total_fee_a_amount / total_fee_b_amountLifetime fees claimed from the DAMM v1 lock escrow.
user_total_claimed_fee_a / user_total_claimed_fee_bLifetime fees claimed through user claim_fee flows.

TopStakerInfo

FieldMeaning
top_list_lengthConfigured maximum number of top stakers.
current_lengthCurrent allocated top list length used for account resizing.
effective_stake_amountTotal stake amount currently in the top list.
last_claim_fee_atLast time the vault claimed from the DAMM v1 lock escrow.
last_updated_atLast fee drip update timestamp.
locked_fee_a / locked_fee_bClaimed fees still locked for drip release.
cumulative_fee_a_per_liquidity / cumulative_fee_b_per_liquidityFee growth checkpoints scaled by 2^64.

StakeEscrow

StakeEscrow is the user position account for one vault.
FieldMeaning
ownerWallet that owns the stake escrow.
vaultParent FeeVault.
full_balance_indexIndex into the full balance list, or FULL_BALANCE_LIST_HARD_LIMIT when not tracked.
stake_amountActive stake amount.
in_top_list1 when the escrow is currently in the top list.
ongoing_total_partial_unstake_amountAmount reserved by open unstake requests for this escrow.
created_atUnix timestamp when the stake escrow was initialized.
fee_a_claimed_amount / fee_b_claimed_amountLifetime user-claimed fee totals.
fee_a_per_liquidity_checkpoint / fee_b_per_liquidity_checkpointLast fee-per-liquidity checkpoints for this escrow.
fee_a_pending / fee_b_pendingPending fee balances not yet claimed by the user.
When a user calls claim_fee, the base/stake token side is automatically restaked. Only the quote token side is transferred to the user, capped by max_fee.

Unstake

Unstake stores one pending withdrawal request.
FieldMeaning
stake_escrowStake escrow that requested the unstake.
unstake_amountAmount reserved for withdrawal.
created_atTimestamp when the request was created.
release_atEarliest timestamp when withdraw can transfer stake tokens back.
ownerOwner that can cancel or withdraw.
vaultParent FeeVault.
request_unstake creates this account with an arbitrary keypair supplied by the caller. cancel_unstake and withdraw close it to the owner.

Top List Account

TopListMetadata is a zero-copy account header followed by StakerMetadata entries.
TypeFieldMeaning
TopListMetadatavaultParent vault.
StakerMetadatastake_amountStake amount used for ranking.
StakerMetadatafull_balance_indexIndex in the full balance list. Negative values mark empty slots.
StakerMetadataownerOwner wallet for indexing and PDA derivation.
Ranking uses stake amount first. For equal balances, earlier full balance indexes rank ahead of later joiners.

Full Balance List Account

FullBalanceListMetadata is a zero-copy account header followed by StakerBalance entries.
TypeFieldMeaning
FullBalanceListMetadatavaultParent vault.
FullBalanceListMetadatalengthNumber of tracked entries.
StakerBalancebalanceCurrent stake amount for the owner.
StakerBalanceownerOwner wallet.
StakerBalanceis_in_top_list1 when the entry is also in the top staker list.
The public hard limit is 10000 tracked entries. If the full balance list is full, a new or returning large staker can reclaim the smallest tracked index only when the required smallest_stake_escrow account is provided.