xVault Docs
Reference

Instructions

The public instruction surface of every xVault Anchor program, with authority and effect.

The canonical source for instruction layouts is the IDL, consumed via packages/sdk. This page is a navigation reference — read it to find the right ix; read the IDL for the exact account and argument shape.

xvault_vault

InstructionAuthorityEffect
init_vault(args)Admin multisigOne-shot: configures SKU, holdings, fee params, keeper and admin authorities.
deposit(usdc_amount, min_shares_out)UserTransfers USDC in, reads NAV from oracle, mints shares pro-rata.
withdraw_in_kind(shares)UserBurns shares; returns raw pro-rata xStock amounts. No fee.
withdraw_usdc(shares, max_slip_bps)UserBurns shares; pays USDC from the cash buffer. 0.05% fee.
rebalance_leg(args)KeeperValidates and books the post-trade deltas of an xChange / Jupiter fill; enforces slippage.
collect_mgmt_fee()PermissionlessMints streamed 0.2%/yr management fee to treasury.
collect_perf_fee()PermissionlessHWM-based performance-fee collection.
set_paused(paused)Admin multisigLegacy full-stop: sets the halted flag. Blocks deposits, rebalance, fee collection; leaves withdraw_in_kind open.
set_pause_flags(flags)Admin multisigGranular control: overwrites the full PauseFlags set (deposits_paused, rebalance_paused, oracle_frozen, halted).
update_weights(new_weights[])Admin multisigUpdates target weights. Subject to 48 h timelock.

xvault_oracle

InstructionAuthorityEffect
init_snapshot(sku)Admin multisigCreates the nav_snapshot PDA for a SKU (up to 20 leg entries).
push_snapshot(entries, sig)Authorized keeperEd25519-verified NAV snapshot write; updates updated_slot.
update_keeper_set(keepers[])Admin multisigRotates the authorized keeper set. 48 h timelock.

Staleness limits: 60 s market hours, 300 s off-hours. NAV-sensitive ix in xvault_vault revert with StaleNav if exceeded.

xvault_rewards

InstructionAuthorityEffect
stake(amount, tier)UserLocks $VLT into a 30/90/180 d pool with pro-rata weight.
unstake(receipt)UserReturns $VLT after the lockup expires.
distribute_epoch(epoch_id, merkle_root)Authorized keeperPosts the Merkle root for that epoch's xStock payout.
claim(proof, amounts[])UserClaims the user's pro-rata basket using an inclusion proof.

Common error codes

CodeProgramWhen it fires
StaleNavvaultOracle snapshot older than MAX_STALE_SECS.
MultiplierMismatchvaultOn-chain multiplier differs from expected.
SlippageExceededvaultRebalance leg delta exceeds rebalance_slippage_bps.
VaultPausedvaultDeposit / rebalance attempted on a paused vault.
WeightSumInvalidvaultProposed weights don't sum to 10 000 bps.
AssetHaltedvaultAsset's atomic trading halted and vault isn't paused.
KeeperUnauthorizedoracle / rewardsSigner not in the authorized keeper set.

See Invariants for the full set of on-chain guards and the authority boundary table.

On this page