Skip to main content
These ExponentVault methods build instructions without submitting them. Amounts use atomic token or LP units; use bigint. LP tokens use SPL Token; deposit and payout mints may use Token or Token-2022.

Deposit

await vault.ixsDepositLiquidity(params) returns TransactionInstruction[], including LP ATA creation and native SOL preparation when needed.
LP output accounts for fee dilution and current valuation. Deposits, instant withdrawals, fills, and claims recalculate AUM from their supplied live accounts and same-slot prices; they do not require a separate stored fresh-AUM flag check. Prepare complete price and protocol inputs with Refresh AUM.

Instant withdrawals

Quotes are snapshots, not reserved capacity. Output mint selection does not change capacity’s base denomination. await ixExecuteWithdrawalFromReservesWithResolvedAumAccounts(params) returns one instruction with complete derivable valuation accounts. The synchronous ixExecuteWithdrawalFromReserves uses only loaded-state accounts plus supplied extras. No manager signer or minimum-output argument is provided. Program capacity and rolling withdrawal limits apply at execution.

Queue a withdrawal

vault.ixQueueWithdrawal({ depositor, lpAmount, tokenLpSrc?, tokenProgram?, systemProgram?, tokenLpEscrow?, extraRemainingAccounts? }) returns { ix, withdrawalKeypair }.
LP source defaults to the depositor’s SPL ATA; escrow and programs default to vault/SPL/System values. The request is a new signer-created account, not a PDA. LP must be positive; withdrawals must be enabled and the NAV/AUM circuit breaker unblocked. Queueing locks LP without burning it.

Fill a withdrawal

For ordinary requests, the transaction builder accepts:
full rejects insufficient liquidity. { kind: "up-to-base", maxBaseAmountAtomic } caps the fill in underlying/base units. Optional tokenEntryIndices limits payout assets; default planning uses positive entries in vault order.

Instruction builder

await ixFillWithdrawalWithResolvedAumAccounts({ withdrawalAccount, fills, tokenAccountTriples, proposal?, ...overrides }) returns an instruction. ixFillWithdrawal is its loaded-state counterpart. The Squads vault must sign through policy execution; a manager signature alone cannot invoke the raw instruction. AUM accounts precede transfer quadruples. Fill burns LP and records payouts. The SDK’s semantic managerAction.fillWithdrawal omits the proposal account; OptOut fills require the resolved instruction with proposal supplied, wrapped in policy execution. See manual construction.

Claim a withdrawal

await ixExecuteWithdrawalWithResolvedAumAccounts({ owner, withdrawalAccount, tokenAccountPairs, tokenProgram?, token2022Program?, mintLp?, tokenLpEscrow?, extraRemainingAccounts? }) returns one instruction. The synchronous ixExecuteWithdrawal uses loaded-state valuation accounts. Build transfer pairs from the stored request fills, preserving their order:
Initialize every owner destination using the mint’s actual token program. The owner’s canonical SPL LP ATA must also exist, even for a full fill. Do not derive pairs from current token entries: a stored fill can outlive an entry. The SDK appends [source writable, mint read-only, destination writable] per pair, then AUM accounts. Its serialized transfer-prefix length is 3 × pairs.length (u8); the program derives this length from stored fills. The original owner signs. Claim requires at least some filled LP and the configured claim time reached. It transfers all recorded payouts, returns any unfilled LP, and closes the request. LP was burned during fill, not claim. A partial request can be claimed once; it does not remain queued afterward.

Cancel a withdrawal

vault.ixCancelWithdrawal({ owner, withdrawalAccount, tokenLpDst?, tokenProgram?, tokenLpEscrow? }) returns one instruction. The owner signs; LP destination defaults to the owner’s initialized SPL ATA. Cancellation requires an ordinary request, positive requested LP, no fills, elapsed cancellation cooldown, and an unblocked NAV/AUM circuit breaker. It returns all LP and closes the request. The claim lock schedule is separate from cancellation cooldown. OptOut requests cannot use this method. The queued-withdrawal example covers queue, fill, claim, and cancellation in separate runs.