API Reference
This document provides a comprehensive API reference for all Ignition Stake Pool components including the FOGO blockchain program instructions, TypeScript SDK, CLI commands, and Python client.
Program Instructions API
Program ID
SP1s4uFeTAX9jsXXmwyDs1gxYYf7cdDZ8qHUHVxE1yr
Core Data Structures
The program uses several key data structures for managing pool state. For complete struct definitions and field-level details, refer to the source code in program/src/state.rs.
Key Structures:
StakePool: Main pool account (~555 bytes)
ValidatorStakeInfo: Individual validator information (~88 bytes per validator)
Fee: Numerator/denominator fee structure
FutureEpoch: Time-based configuration changes
Refer to the program source code for detailed field specifications.
Program Instructions Reference
Pool Management Instructions
Initialize
Creates a new stake pool.
Accounts (10):
[w]New StakePool account[s]Manager[]Staker[]Stake pool withdraw authority (PDA)[w]Validator list storage account[]Reserve stake account[]Pool token mint[]Manager fee account[]Token program[](Optional) Deposit authority
PDA Seeds:
Withdraw Authority:
[stake_pool_address, b"withdraw"]Deposit Authority:
[stake_pool_address, b"deposit"]
SetManager
Updates the pool manager.
Accounts (4):
[w]Stake pool[s]Current manager[s]New manager[]New manager fee account
SetFee
Updates pool fees.
Accounts (2):
[w]Stake pool[s]Manager
Validator Management Instructions
AddValidatorToPool
Adds a validator to the stake pool.
Accounts (13):
[w]Stake pool[s]Staker[w]Reserve stake account[]Withdraw authority[w]Validator list[w]Validator stake account[]Validator vote account[]Rent sysvar[]Clock sysvar[]Stake history sysvar[]Stake config sysvar[]System program[]Stake program
RemoveValidatorFromPool
Removes a validator from the stake pool.
Accounts (8):
[w]Stake pool[s]Staker[]Withdraw authority[w]Validator list[w]Validator stake account[w]Transient stake account[]Clock sysvar[]Stake program
IncreaseValidatorStake
Increases stake on a validator from the reserve.
Accounts (14):
[]Stake pool[s]Staker[]Withdraw authority[w]Validator list[w]Reserve stake[w]Transient stake account[]Validator stake account[]Validator vote account[]Clock sysvar[]Rent sysvar[]Stake history sysvar[]Stake config sysvar[]System program[]Stake program
User Operations Instructions
DepositSol
Deposits tokens into the pool's reserve.
Accounts (11):
[w]Stake pool[]Withdraw authority[w]Reserve stake account[s]Funding account[w]Destination pool token account[w]Manager fee account[w]Referrer pool token account[w]Pool token mint[]System program[]Token program[s](Optional) tokens deposit authority
WithdrawSol
Withdraws tokens from the pool's reserve.
Accounts (13):
[w]Stake pool[]Withdraw authority[s]User transfer authority[w]Source pool token account[w]Reserve stake account[w]Destination system account[w]Manager fee account[w]Pool token mint[]Clock sysvar[]Stake history sysvar[]Stake program[]Token program[s](Optional) tokens withdraw authority
DepositWsolWithSession
Deposits wrapped SOL (WSOL) into the pool using a session token (FOGO blockchain specific).
Accounts (12):
[w]Stake pool[]Withdraw authority[w]Reserve stake account[s]Session authority[w]User pool token account[w]Manager fee account[w]Referrer pool token account[w]Pool token mint[]System program[]Token program[]Session token account[s]User wallet (payer)
Description: Enables gasless deposits on FOGO blockchain using session tokens. Session authority signs on behalf of users for improved UX.
WithdrawWsolWithSession
Withdraws wrapped SOL (WSOL) from the pool using a session token (FOGO blockchain specific).
Accounts (13):
[w]Stake pool[]Withdraw authority[s]Session authority[w]User pool token account[w]Reserve stake account[w]Destination WSOL account[w]Manager fee account[w]Pool token mint[]Clock sysvar[]Stake history sysvar[]Stake program[]Token program[]Session token account
Description: Enables gasless withdrawals on FOGO blockchain using session tokens. Session authority validates and processes withdrawals without requiring individual wallet signatures.
DepositStake
Deposits a stake account into the pool.
Accounts (15):
[w]Stake pool[w]Validator list[s]/[]Deposit authority[]Withdraw authority[w]Stake account to deposit[w]Validator stake account[w]Reserve stake account[w]Destination pool token account[w]Manager fee account[w]Referrer pool token account[w]Pool token mint[]Clock sysvar[]Stake history sysvar[]Token program[]Stake program
WithdrawStake
Withdraws stake from the pool.
Accounts (13):
[w]Stake pool[w]Validator list[]Withdraw authority[w]Source validator/reserve stake[w]Destination stake account[]New stake authority[s]User transfer authority[w]Source pool token account[w]Manager fee account[w]Pool token mint[]Clock sysvar[]Token program[]Stake program
Maintenance Instructions
UpdateValidatorListBalance
Updates validator balances and processes transient stakes.
Accounts (7 + 2N):
[]Stake pool[]Withdraw authority[w]Validator list[w]Reserve stake[]Clock sysvar[]Stake history sysvar[]Stake program[]N pairs of (validator stake, transient stake)
UpdateStakePoolBalance
Updates the pool's total balance.
Accounts (7):
[w]Stake pool[]Withdraw authority[w]Validator list[]Reserve stake[w]Manager fee account[w]Pool token mint[]Token program
TypeScript SDK API
Installation
Core Functions
getStakePoolAccount
Retrieves and deserializes a stake pool account.
Parameters:
connection: FOGO RPC connection
stakePoolAddress: Stake pool public key
Returns:
StakePoolAccount: Object containing pubkey and decoded account data
Example:
getStakePoolAccounts
Retrieves all stake pool and validator list accounts.
Parameters:
connection: FOGO RPC connection
stakePoolProgramAddress: Program ID
Returns:
Array of stake pool and validator list accounts
depositSol
Creates instructions for tokens deposit.
Parameters:
connection: FOGO RPC connection
stakePoolAddress: Stake pool public key
from: Source tokens account
lamports: Amount to deposit in lamports
destinationTokenAccount: Pool token destination (optional)
referrerTokenAccount: Referrer token account (optional)
depositAuthority: Required deposit authority (optional)
Returns:
Object with transaction instructions and required signers
withdrawSol
Creates instructions for tokens withdrawal.
Parameters:
connection: FOGO RPC connection
stakePoolAddress: Stake pool public key
tokenOwner: Pool token owner
solReceiver: tokens destination account
amount: Pool tokens to burn
solWithdrawAuthority: Required withdraw authority (optional)
Returns:
Object with transaction instructions and required signers
depositWsolWithSession
Creates instructions for WSOL deposit using FOGO session tokens (gasless transaction).
Parameters:
connection: FOGO RPC connection
stakePoolAddress: Stake pool public key
sessionAuthority: Session token authority
userTokenAccount: User's pool token account
amount: Amount of WSOL to deposit in lamports
referrerTokenAccount: Referrer token account (optional)
Returns:
Object with transaction instructions and required signers
Description: This function enables gasless deposits on FOGO blockchain by leveraging session tokens. The session authority signs transactions on behalf of users, providing a seamless UX without requiring wallet signatures for each transaction.
withdrawWsolWithSession
Creates instructions for WSOL withdrawal using FOGO session tokens (gasless transaction).
Parameters:
connection: FOGO RPC connection
stakePoolAddress: Stake pool public key
sessionAuthority: Session token authority
userTokenAccount: User's pool token account
wsolReceiver: Destination WSOL account
amount: Pool tokens to burn
Returns:
Object with transaction instructions and required signers
Description: This function enables gasless withdrawals on FOGO blockchain by leveraging session tokens. The session authority validates and processes withdrawals, allowing users to unstake without signing individual transactions.
depositStake
Creates instructions for stake account deposit.
withdrawStake
Creates instructions for stake withdrawal.
Validator Management Functions
addValidatorToPool
removeValidatorFromPool
increaseValidatorStake
decreaseValidatorStake
Pool Information Functions
stakePoolInfo
Retrieves comprehensive stake pool information.
Returns:
updateStakePool
Creates all instructions needed to update a stake pool.
Utility Functions
lamportsToSol / solToLamports
Convert between tokens and lamports.
calcLamportsWithdrawAmount
Calculate tokens amount for given pool tokens.
Constants
Common Error Solutions
StakeListOutOfDate
Validator list needs update
Run update-validator-list-balance
ValidatorAlreadyAdded
Validator already in pool
Check validator list before adding
FeeTooHigh
Fee numerator >= denominator
Set reasonable fee values
WithdrawTooLarge
Insufficient pool balance
Check available withdrawal amount
CalculationFailure
Math overflow
Use reasonable amounts
Last updated
