Documentation Index
Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt
Use this file to discover all available pages before exploring further.
The WithdrawalAccount tracks an individual depositor’s queued withdrawal request. It is created when a depositor calls queueWithdrawal and closed when the withdrawal is executed or cancelled.
Program ID: sVau1tXvayVWfotzm9Ahcv2qfnnfRWttt78BCnNC6dD
WithdrawalAccount
#[account]
pub struct WithdrawalAccount {
/// The vault this withdrawal is from
pub vault: Pubkey,
/// The depositor who owns this withdrawal
pub owner: Pubkey,
/// Type of withdrawal (Sol or Token)
pub withdrawal_type: WithdrawalType,
/// Original LP amount requested for withdrawal
pub lp_amount_requested: u64,
/// Remaining LP amount not yet filled
pub lp_amount_remaining: u64,
/// Token fills — each fill records a mint and amount
pub fills: Vec<WithdrawalTokenFill>,
/// Unix timestamp when the withdrawal was created
pub created_at: u32,
/// Unix timestamp when the withdrawal was last updated (filled)
pub updated_at: u32,
/// Reserved bytes for future use
pub reserved: [u8; 8],
}
WithdrawalType
pub enum WithdrawalType {
Sol,
Token,
}
WithdrawalTokenFill
Each fill records a token and amount allocated to the withdrawal by the vault manager:
pub struct WithdrawalTokenFill {
pub mint: Pubkey,
pub token_amount: u64,
}
Lifecycle
| State | Description |
|---|
| Queued | Created by depositor. LP tokens moved to escrow. lp_amount_remaining == lp_amount_requested |
| Partially Filled | Manager has filled some tokens. lp_amount_remaining > 0, fills.len() > 0 |
| Fully Filled | Manager has filled all tokens. lp_amount_remaining == 0 |
| Executed | Depositor has claimed tokens. Account is closed |
| Cancelled | Depositor cancelled. LP returned, account closed |
TypeScript
import { fetchWithdrawalAccountAccount } from "@exponent-labs/exponent-sdk/client/vaults";
const { data } = await fetchWithdrawalAccountAccount(connection, withdrawalAddress);
console.log(data.lpAmountRequested); // bigint
console.log(data.lpAmountRemaining); // bigint
console.log(data.fills); // WithdrawalTokenFill[]
console.log(data.createdAt); // number (unix timestamp)
Or via the ExponentVault class:
const withdrawal = await vault.fetchWithdrawalAccount(withdrawalAddress);