Solana Actions
Execute transactions on Solana vaults including deposits, withdrawals, and queries. All operations follow the same pattern as EVM vaults for consistency.
Overview
Solana vault interactions use the same pattern as EVM:
Use
sdk.getVault()to query vault dataUse
sdk.solana.vaultDeposit()to depositUse
sdk.solana.vaultRedeem()to withdraw
A vault with a withdrawal queue withdraws in two steps instead, like an EVM vault's request and claim: sdk.solana.vaultRequestRedeem(), then sdk.solana.vaultRedeem() with the request once its cooldown has run. See Vaults with a Withdrawal Queue.
The SDK handles all Solana-specific complexities (PDAs, token accounts, etc.) automatically.
Setup
Basic Initialization
Include Solana RPC endpoint when initializing the SDK:
import AugustSDK from '@augustdigital/sdk';
const sdk = new AugustSDK({
appName: 'your-app-name', // required
providers: {
-1: 'https://api.mainnet-beta.solana.com', // Solana Mainnet
},
});
// Access Solana adapter
const solana = sdk.solana;Custom RPC Endpoint
For Write Operations
To execute transactions, you need to set a wallet provider:
Adapter API
Methods
setWalletProvider()
Set the wallet provider for write operations.
Parameters:
publicKey: User's Solana public keysignTransaction: Function to sign transactions (from wallet adapter)
Example:
Get Vault Data
Query Solana vault information using the same sdk.getVault() method as EVM vaults.
Parameters
vault
string
Yes
Solana vault program ID
options.solanaWallet
string
No
User's Solana public key for position data
Example
Get All Solana Vaults
Get User Positions
Vault Deposit
Deposit tokens into a Solana vault. The SDK derives the vault PDAs, creates the depositor's share token account when it is missing, and sends the program's deposit_checked instruction through the wallet registered with setWalletProvider.
Parameters
vaultProgramId
PublicKey | string
Yes
Vault program ID — Solana.constants.programIds['mainnet-beta'].vault on mainnet
idl
object
Yes
Program IDL — pass Solana.constants.vaultIdl
publicKey
PublicKey | string
Yes
Depositor's wallet public key
depositAmount
number | bigint
Yes
bigint is raw on-chain units; number is a UI amount converted with the deposit mint's decimals
sendTransaction
undefined
No
Ignored and scheduled for removal. Pass undefined rather than dropping the argument, or vaultAddress shifts into this slot
vaultAddress
PublicKey | string
No
Vault state account. Omit only for legacy single-vault programs, which derive it from the program ID
options
ISolanaDepositOptions
No
Slippage protection, see below
Slippage protection
Deposits send the program's deposit_checked instruction. The SDK quotes the shares the deposit should mint from the vault's current state and passes that quote, lowered by a tolerance, as min_shares_out; the program reverts with SlippageExceeded if the share price moves past it before execution. Control it with the trailing options argument:
Returns
Transaction signature as string.
Example
Behavior
The SDK automatically:
Fetches the vault state and derives the PDAs
Creates the share token account when the depositor has none, in the same transaction
Converts a
numberamount to raw units with the deposit mint's decimalsQuotes the expected shares and applies the slippage floor
Signs through the registered wallet and confirms at the adapter's commitment level (
finalizedby default)
Vault Withdraw
Redeem shares from a Solana vault. The program's redeem_checked instruction burns the shares and transfers the payout in the same transaction.
This instant path is for vaults without a withdrawal queue. On a vault with one attached, a direct redeem is refused before signing, with an AugustValidationError pointing to Request Withdrawal; pass the request as options.request to claim it instead.
Parameters
vaultProgramId
PublicKey | string
Yes
Vault program ID — Solana.constants.programIds['mainnet-beta'].vault on mainnet
idl
object
Yes
Program IDL — pass Solana.constants.vaultIdl
publicKey
PublicKey | string
Yes
Share holder's wallet public key
redeemShares
number | bigint
Yes
bigint is raw share units; number is a UI amount
sendTransaction
undefined
No
Ignored and scheduled for removal. Pass undefined rather than dropping the argument, or vaultAddress shifts into this slot
vaultAddress
PublicKey | string
No
Vault state account. Omit only for legacy single-vault programs
options
ISolanaRedeemOptions
No
Slippage protection, see below
Slippage protection
Redemptions send redeem_checked. The floor is on what the wallet receives, net of the withdrawal fee, quoted from the vault state the SDK already reads; the default tolerance is 50 bps. Pass slippageBps or an explicit minAssetsOut (raw deposit-mint units) in the trailing options argument, exactly as for deposits. A SlippageExceeded revert is reported with a message saying the price moved past your tolerance and to retry or raise it.
Returns
Transaction signature as string.
Example
Vaults with a Withdrawal Queue
A vault can have a withdrawal queue attached. While it does, shares cannot be redeemed directly. A holder withdraws in two steps:
Request.
vaultRequestRedeemmoves the shares into escrow in a request account, which starts the queue's cooldown.Claim. Once the cooldown has run,
vaultRedeemwithoptions.requestredeems the escrowed shares and pays the request's recipient.
The claim prices the shares when it settles, not when the request was made, at the share price of that moment and net of the vault's withdrawal fee. It never pays less than the request's floor, set when the request is made: by default the net quote at that moment lowered by 50 bps, so a fee rise or AUM mark-down in between makes the claim fail rather than pay less, while yield earned in the meantime is still paid. Anyone the request permits may claim it: the holder, and anyone else unless the request names a finalizer, so a keeper can settle it for the holder. Until it is claimed, the holder can cancel the request to get the shares back.
A queue may also set a fulfillment window: a request not claimed within it after its cooldown expires, and can then only be cancelled.
Check a vault before choosing the path:
vault.withdrawalQueue is absent for a vault that never had a queue. For one that did, it reports:
address
The queue account
enabled
Whether the vault's redemptions go through this queue. false once the queue has been released, when the vault is back to instant redemption while any requests made before still settle
cooldownSeconds
Wait between a new request and its claim
fulfillmentWindowSeconds
How long after the cooldown a new request stays claimable; 0 for no limit
pendingCount
Requests not yet claimed or cancelled, across all holders
pendingShares
Shares escrowed across those requests
Request Withdrawal
Put shares into a withdrawal request on a vault with a withdrawal queue.
Parameters
vault
PublicKey | string
Yes
Vault state account
wallet
PublicKey | string
Yes
The holder, who signs and pays the request account's rent (refunded when it is claimed or cancelled)
amount
number | bigint
Yes
Shares to escrow: bigint is raw share units; number is a UI amount
recipient
PublicKey | string
No
Wallet the claim pays. Defaults to the holder. Its deposit-token account is created in the same transaction when missing, at the holder's expense; multisig vaults and program addresses are accepted
finalizer
PublicKey | string
No
The one key besides the holder allowed to claim. Defaults to anyone
requestId
bigint
No
The request's id, unique per holder while pending. Defaults to a random u64
slippageBps
number
No
Tolerance below the quoted net payout for the request's floor, 0 to 10000. Defaults to 50. Ignored when minAssetsOut is given
minAssetsOut
bigint
No
Explicit floor in raw deposit-mint units, net of the withdrawal fee. 0n for no floor
Returns
{ signature, request, requestId }: the transaction signature, the new request account's address (pass it as request to claim or cancel), and its id as a decimal string.
Example
Behavior
Before asking the wallet to sign, the SDK:
Reads the vault state and its queue, and refuses a vault without an attached queue
Converts a
numberamount to raw units with the share mint's decimalsRefuses the request if the holder's share account is frozen or holds too few shares, or if the recipient's token account is frozen (every claim would then fail)
Creates the recipient's deposit-token account when missing, in the same transaction
Quotes the net payout from the vault state and sets the floor from it, unless
minAssetsOutis given. A vault with no share price (no assets, shares outstanding) cannot be quoted; passminAssetsOut: 0nto request without a floor
Check Requests
List a wallet's requests on a vault with sdk.getVaultAvailableRedemptions() or sdk.getVaultPositions(), as for EVM vaults. For Solana, wallet is the holder's base58 address.
pendingRedemptions
READY_TO_CLAIM
Past its cooldown; can be claimed now
availableRedemptions
AWAITING_COOLDOWN
Still in its cooldown; date is when it can be claimed
availableRedemptions
EXPIRED
Past its fulfillment window; can only be cancelled
Each entry's id is the request account's address, and what request expects. amount is the escrowed shares; estimatedAssets is what claiming would pay now, in deposit tokens and net of the withdrawal fee. It is an estimate, since the claim prices at settlement. receiver is the wallet the request pays.
Claim Redemption
Claim a request once its cooldown has run: pass it to vaultRedeem as options.request.
The request fixes the shares, the recipient and the vault, so redeemShares and vaultAddress are ignored. The floor was fixed when the request was made, so slippageBps and minAssetsOut must not be set alongside request. A claim that would pay less than that floor fails with PayoutBelowFloor and leaves the request pending.
Returns
Transaction signature as string.
Example
Behavior
Before asking the wallet to sign, the SDK refuses a claim that could only fail: by a key the request does not permit, during the cooldown, past the fulfillment window, or to a payout account that is frozen. A payout account closed since the request is recreated in the same transaction when it is the holder's associated token account; any other closed payout account is refused, and the holder can cancel the request instead. The SDK also creates the vault's fee-recipient account when missing, in the same transaction. If the vault's liquid reserve cannot cover the payout, the claim fails with NotEnoughLiquidity and the request stays pending to be claimed later.
Cancel Request
Cancel a pending request, returning its shares to the holder.
Parameters
wallet
PublicKey | string
Yes
The holder who made the request; no one else may cancel it
request
PublicKey | string
Yes
The request account's address
Returns
Transaction signature as string. The shares return to the holder's share account (recreated if they closed it) and the request's rent is refunded.
Example
A request can be cancelled at any time while it exists: during the cooldown, after it, past the fulfillment window, and while the vault is paused.
Examples
Complete Deposit Flow
Complete Withdrawal Flow
Query Vault Before Depositing
Advanced Operations
For advanced use cases, the Solana adapter exposes low-level methods and utilities.
Direct Program Access
Access Solana connection and provider for custom operations:
Utility Functions
deriveShareMintPda()
Derive the share mint PDA for a vault.
getToken()
Get token metadata from mint address.
getVaultStateReadOnly()
Get vault state without a wallet provider.
getProvider()
Create an Anchor provider with wallet.
getReadOnlyProvider()
Create a read-only Anchor provider.
getProgram()
Create an Anchor program instance.
Constants
Vault IDL
Program IDs
Fallback Values
Error Handling
Connection Errors
Transaction Errors
Withdrawal Queue Errors
Checks the SDK can make itself are thrown as AugustValidationError before the wallet is asked to sign: a vault without a queue, a request still in its cooldown or past its window, a claim by a key the request does not permit, a cancel by anyone but the holder. When the transaction itself fails, the AugustSDKError message carries the program's reason and error code, followed by the next step where there is one:
WithdrawalQueueRequired
Request with vaultRequestRedeem, then claim
CooldownNotElapsed
Claim once the eligibility time has passed
RequestExpired
Cancel the request to get the shares back
FinalizerNotAllowed
Only the holder or the named finalizer may claim
PayoutBelowFloor
Claim once the price recovers, or cancel and request again with a lower floor
StaleRequestSequence
The request changed since it was read; read it again
NotEnoughLiquidity
The vault's reserve cannot cover the payout yet; the request stays pending
Last updated