stake-for-fee-sdk/ts-client/src/examples source and the public SDK surface.
Connect To A Vault
Create A Fee Vault
createFeeVault fetches the DAMM v1 pool, infers the quote mint as the other pool mint, derives the vault/list/token accounts, creates the DAMM v1 lock escrow if missing, and returns one transaction.
Create A Fee Vault With Explicit Mints
createFeeVaultInstructions when you need to compose the vault creation instructions into a larger transaction builder.
Lock DAMM v1 LP To The Vault
The local SDK examples lock DAMM v1 LP with@meteora-ag/dynamic-amm-sdk after the Stake2Earn vault is created:
Stake Tokens
stake includes initializeStakeEscrow when needed. If you have just changed vault state in another transaction, call refreshStates() before building the stake transaction.
Read Stake And Claimable Balance
unclaimFee.
Claim Fees
claimFee claims quote token fees up to maxFee. Any base/stake token fee is automatically added back to the user’s stake escrow.
Request Unstake
unstake.publicKey. It is required for cancelUnstake and withdraw.
Cancel Unstake
Unstake account.
Withdraw Released Stake
Unstake.release_at value.
Find User Vaults And Unstakes
Gotchas
| Gotcha | Recommendation |
|---|---|
claimFee returns one transaction | Send the returned transaction directly; do not iterate over it. |
unstake needs a new signer | Generate and partial-sign with the Unstake keypair. |
| Cached account state | Call refreshStates() before building transactions after recent vault mutations. |
| Top-list replacement accounts | Let the SDK build stake/claim/unstake transactions unless you are comfortable supplying replacement stake escrows manually. |
| Quote-only user claim | Expect only the quote token to leave the vault on claimFee; the stake/base token side is restaked. |

