Revenue Interactions
FAF token staking and the three claimable balances it unlocks — staking rewards, protocol revenue share, and referral rebates. This page covers staking, unstaking, and claiming each balance through Fl
poolConfig.tokenMint // FAF / governance staking mint
poolConfig.revenueTokenAccount // holds the revenue payout mint (read on-chain)
poolConfig.rebateTokenAccount // holds the rebate payout mint (read on-chain)The flow model
Stake FAF
import { BN } from '@coral-xyz/anchor'
import { getAssociatedTokenAddressSync, createAssociatedTokenAccountIdempotentInstruction } from '@solana/spl-token'
import { findTokenStakeDepositReceiptAddress } from '@flash_trade/flash-sdk-v2'
const stakeFaf = async (amount: BN) => {
const owner = flashClient.wallet
const fafMint = poolConfig.tokenMint
const fundingAccount = getAssociatedTokenAddressSync(fafMint, owner)
const [receipt] = findTokenStakeDepositReceiptAddress(owner, flashClient.programId)
const res = await flashClient.depositTokenStakeWithAction({
tokenMint: fafMint,
fundingAccount,
depositAmount: amount,
token22: false, // true if FAF is a Token-2022 mint
})
// Ensure the funding ATA exists (idempotent).
res.instructions.unshift(
createAssociatedTokenAccountIdempotentInstruction(owner, fundingAccount, owner, fafMint),
)
await flashClient.sendAndConfirmTransaction(res.instructions, {
additionalSigners: res.additionalSigners,
skipPreflight: true,
})
// Wait for the settle step to close the receipt.
await pollClosed(receipt) // see LP Interactions for the poller helper
}
await stakeFaf(new BN(1_000_000))Unstake (begin the unlock)
Cancel a pending unstake
Withdraw a matured unstake
Reading your stake & claimable balances
Claim staking rewards
Claim protocol revenue
Claim referral rebates
Link a referrer
Last updated
Was this helpful?

