Skip to main content
These examples are based on the local vault-sdk/ts-client source and tests. They focus on transaction construction and state reads. For the full method catalog, see the SDK Reference.

Setup

Use a real wallet adapter in browser apps. The generated keypair pattern is only suitable for local scripts and tests.

Fetch Vault State

Convert LP To Underlying

Convert Desired Output To LP Burn

Deposit

For a native SOL vault, the SDK wraps SOL into the user’s wrapped SOL ATA before the deposit instruction.

Withdraw

For a native SOL vault, the SDK adds a post-instruction to close the wrapped SOL ATA.

Batch Load Vaults

Batch Load User LP Balances

Derive Vault PDAs

Create A Permissionless Vault Instruction

This helper builds the program initialize instruction and derives the vault, token vault, and LP mint PDAs.

Affiliate Flow

With affiliateId, deposit and withdraw use the affiliate program wrapper and derive affiliate user LP token accounts internally.