Skip to main content

Installation

Imports

Token and Oracle Support

  • Token standards: SPL and Token Extensions (Token22) are supported in vault composition and token flows (addOrEditTokenTx, buyVaultTx, sellVaultTx, depositTokensTx, redeemTokensTx, etc.).
  • Oracle types: Pyth, Raydium CLMM, Raydium CPMM, and LST (SPL/Sanctum stake pool) are supported.

SymmetryCore

Constructor

Configuration

setPriorityFee(priorityFee: number): void

Updates the priority fee for all subsequent transactions.

fetchGlobalConfig(): Promise<GlobalConfig>

Returns the protocol-wide configuration account.

Vault Methods

Fetching

fetchVault(vaultPubkey: string): Promise<Vault>

Fetch a single vault by its on-chain account public key. Does not load oracle prices — call loadVaultPrice() separately.

fetchMultipleVaults(vaultPubkeys: string[]): Promise<Map<string, Vault>>

Batch-fetch multiple vaults. Returns a map keyed by public key.

fetchAllVaults(filter?: VaultFilter): Promise<Vault[]>

Fetch all vaults on-chain with an optional filter:

fetchCreatedVaults(creatorPubkey: string): Promise<Vault[]>

Shorthand for fetchAllVaults({ type: "creator", pubkey }).

fetchHostedVaults(hostPubkey: string): Promise<Vault[]>

Shorthand for fetchAllVaults({ type: "host", pubkey }).

fetchManagedVaults(managerPubkey: string): Promise<Vault[]>

Shorthand for fetchAllVaults({ type: "manager", pubkey }).

fetchVaultsFromMints(mints: string[]): Promise<Map<string, Vault>>

Fetch vaults by their token mint addresses.

deriveVaultsByMints(mints: string[]): Promise<Map<string, string>>

Derive vault account addresses from mint addresses without RPC calls.

loadVaultPrice(vault: Vault): Promise<Vault>

Loads live oracle prices, computes TVL and vault token price. Populates vault.tvl, vault.price, and per-asset price/value.

Creation

createVaultTx(params): Promise<VaultCreationTx>

Creates a new vault. The metadata_uri is a URL (max 200 chars) pointing to a JSON file with the vault’s metadata. The JSON should contain: name (vault token name), symbol (vault token ticker), description (vault description), image (token image/icon URL), and cover (vault cover image URL). You can include additional fields for your own integrations.

Editing

All edit methods accept a TaskContext and settings, returning Promise<TxPayloadBatchSequence>:

Token Composition

addOrEditTokenTx(ctx, settings): Promise<TxPayloadBatchSequence>

Add a new token or edit an existing token’s oracle configuration. Settings type: AddOrEditTokenInput.

updateWeightsTx(ctx, settings): Promise<TxPayloadBatchSequence>

Update target weights for tokens in the vault. Settings type: UpdateWeightsInput.

makeDirectSwapTx(ctx, settings, jup_swap_ix?): Promise<TxPayloadBatchSequence>

Execute a direct token swap within the vault. Settings type: MakeDirectSwapInput.

Intent Methods

Fetching

fetchIntent(intentPubkey: string): Promise<Intent>

fetchMultipleIntents(intentPubkeys: string[]): Promise<Map<string, Intent>>

fetchAllIntents(filter?: IntentFilter): Promise<Intent[]>

fetchCreatedIntents(creatorPubkey: string): Promise<Intent[]>

fetchVaultIntents(vaultPubkey: string): Promise<Intent[]>

Execution & Cancellation

executeVaultIntentTx(params): Promise<TxPayloadBatchSequence>

Execute a pending intent after its time-lock has elapsed.

executeDirectSwapVaultIntentTx(params): Promise<TxPayloadBatchSequence>

Execute a pending direct swap intent with a flash swap.

cancelVaultIntentTx(params): Promise<TxPayloadBatchSequence>


Rebalance Intent Methods

Fetching

fetchRebalanceIntent(pubkey: string): Promise<UIRebalanceIntent>

fetchMultipleRebalanceIntents(pubkeys: string[]): Promise<Map<string, UIRebalanceIntent>>

fetchAllRebalanceIntents(filter?: RebalanceIntentFilter): Promise<UIRebalanceIntent[]>

fetchOwnerRebalanceIntents(ownerPubkey: string): Promise<UIRebalanceIntent[]>

fetchVaultRebalanceIntents(vaultPubkey: string): Promise<UIRebalanceIntent[]>


Deposit & Withdrawal Methods

buyVaultTx(params): Promise<TxPayloadBatchSequence>

Deposit tokens into a vault to receive vault tokens.

depositTokensTx(params): Promise<TxPayloadBatchSequence>

Add more tokens to an existing deposit before locking.

lockDepositsTx(params): Promise<TxPayloadBatchSequence>

Lock deposits and start the auction process.

sellVaultTx(params): Promise<TxPayloadBatchSequence>

Withdraw from a vault by burning vault tokens. If keep_tokens contains ALL mints from the vault’s composition (including inactive), price updates and auctions are skipped — the withdrawal goes directly to the redeem stage. The user can then call redeemTokensTx themselves (no keeper needed) for the fastest withdrawal path. This is still two transactions: sellVaultTx + redeemTokensTx.

Rebalancing Methods

All rebalancing methods are permissionless. The keeper parameter is simply the signing wallet.

rebalanceVaultTx(params): Promise<TxPayloadBatchSequence>

Trigger a keeper-initiated rebalance to restore target weights.

cancelRebalanceIntentTx(params): Promise<TxPayloadBatchSequence>


Oracle Price Updates

updateTokenPricesTx(params): Promise<TxPayloadBatchSequence>

Refresh on-chain oracle prices for all tokens during a rebalance. Handles Pyth VAA lifecycle automatically.

updatePythPriceFeedsTx(params): Promise<TxPayloadBatchSequence>

Update specific Pyth price feeds standalone (no rebalance context). Find price feed IDs at Pyth Price Feed IDs.

Flash Swaps

flashSwapTx(params): Promise<TxPayloadBatchSequence>

Execute an atomic flash swap during rebalance auctions.

Minting & Redeeming

These methods are permissionless. The keeper parameter is simply the signing wallet — any user can call them. Users performing a fast withdrawal (all keep_tokens) can call redeemTokensTx directly without waiting for a keeper.

mintTx(params): Promise<TxPayloadBatchSequence>

Mint vault tokens after a deposit rebalance completes auctions.

redeemTokensTx(params): Promise<TxPayloadBatchSequence>

Redeem underlying tokens from a withdrawal that has reached the redeem stage. For fast withdrawals (all keep_tokens), this is ready immediately after sellVaultTx.

Bounties

addBountyTx(params): Promise<TxPayloadBatchSequence>

Add bounty to a vault for incentivizing keeper automation.

claimBountyTx(params): Promise<TxPayloadBatchSequence>

Distribute earned bounties to all keepers who completed tasks during the rebalance, award a task bounty to the caller, return unused bounty to the depositor, and close the rebalance intent account. Any wallet can call this.

Fee Management

withdrawVaultFeesTx(params): Promise<TxPayloadBatchSequence>

Withdraw accumulated fees. Auto-detects which fee types the claimer can collect.

claimTokenFeesFromVaultTx(params): Promise<TxPayloadBatchSequence>

Claim remaining fee tokens from an existing WithdrawVaultFees account.

Fee Account Fetching

fetchWithdrawVaultFees(pubkey: string): Promise<WithdrawVaultFees>

fetchMultipleWithdrawVaultFees(pubkeys: string[]): Promise<Map<string, WithdrawVaultFees>>

fetchAllWithdrawVaultFees(filter?: WithdrawVaultFeesFilter): Promise<WithdrawVaultFees[]>

Convenience methods: fetchVaultWithdrawVaultFees, fetchManagerWithdrawVaultFees, fetchCreatorWithdrawVaultFees, fetchHostWithdrawVaultFees, fetchSymmetryWithdrawVaultFees.

Lookup Tables

rewriteLookupTablesTx(params): Promise<TxPayloadBatchSequence>

Rebuild address lookup tables for a vault.

Sending Transactions

signAndSendTxPayloadBatchSequence(params): Promise<TransactionSignature[][]>

Sign and send a TxPayloadBatchSequence. Batches are sent sequentially; transactions within a batch in parallel.

signAndSendVersionedTxs(params): Promise<TransactionSignature[][]>

Sign and send pre-built versioned transactions.

Wallet Interface


Standalone Utilities

The on-chain program uses “basket” terminology internally (e.g., Basket, basket_fees, mint_basket). The SDK and documentation use “vault” as the user-facing term. When reading on-chain data or error messages, “basket” and “vault” refer to the same thing.

Constants