Skip to main content
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: HycecAnELpjL1pMp435nEKWkcr7aNZ2QGQGXpzK1VEdV

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

StateDescription
QueuedCreated by depositor. LP tokens moved to escrow. lp_amount_remaining == lp_amount_requested
Partially FilledManager has filled some tokens. lp_amount_remaining > 0, fills.len() > 0
Fully FilledManager has filled all tokens. lp_amount_remaining == 0
ExecutedDepositor has claimed tokens. Account is closed
CancelledDepositor 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);