Skip to main content
The Stake2Earn TypeScript SDK is published as @meteora-ag/m3m3. It wraps the stake_for_fee, DAMM v1, and Dynamic Vault account bundles needed to build Stake2Earn transactions.
The SDK builds unsigned transactions. Your app is responsible for setting any wallet-specific signing flow, simulating, signing, and submitting the returned transaction.

SDK Repository

Source for @meteora-ag/m3m3, examples, tests, IDLs, helpers, and build scripts.

NPM Package

Published Stake2Earn TypeScript SDK package.

Installation

Install the SDK and the packages you commonly import directly in app code:

Create A Client

Create a StakeForFee instance from a DAMM v1 pool address. The SDK derives the Stake2Earn vault PDA, top staker list, full balance list, lock escrow, and related Dynamic Vault state.

Build Transactions

Stake

stake creates the stake escrow first when it does not exist, estimates compute units, and adds replacement top-list accounts from the current cached state.

Claim Fees

claimFee transfers only the quote token side to the user. The stake/base token side is automatically restaked by the program.

Request Unstake

unstake initializes a new Unstake account. The new keypair must sign the final transaction.

Cancel Or Withdraw

withdraw only succeeds after the Unstake.release_at timestamp has passed.

Read User State

Refresh cached vault state before calculating claimable balances for a user-facing surface.

Create A Vault

Vault creation is an integrator or launch workflow. The pool must be a DAMM v1 constant-product pool, the quote mint must be SOL or USDC, and the lock escrow must be owned by the derived vault PDA.
The SDK also exposes createFeeVaultWithParams and createFeeVaultInstructions when you already know both pool mints or need raw instructions.

Contributor Commands

If you have cloned the SDK repository and want to run the built-in tests:

Next Pages

SDK Examples

Common vault, stake, claim, unstake, and read examples.

SDK Reference

Complete function, helper, constant, and type map for @meteora-ag/m3m3.