Skip to main content
Every read needs the read scope. A read returns the data of the API’s { vault, data } body, parsed against the schemas in the SDK. listVaults returns the vaults array of its own { vaults } body. If a response does not match its schema, the method throws an ApiError with the code contract_mismatch. The SDK never returns a half-parsed object. See Errors. Amounts are base-unit strings. The route column names the API endpoint behind each method. Request and response fields are documented in the API reference.

Methods

vault is the vault address. lbPair is the Meteora DLMM pool address. The examples below assume hedge is a client from createHedgeClient and vault and lbPair are address strings.

Vaults

listVaults is the usual first call. Each VaultSummary carries the deposit token’s symbol and decimals, so you can format totalAssets without another request.
getVault returns the on-chain vault state. navPerShare is scaled by 1e9, so "1000000000" means one deposit-mint base unit per share base unit. protocol.maxSlippageBps is the protocol-wide slippage cap.

Holdings and strategies

getHoldings values the vault’s tokens. When some token has no price, partial is true and unpriced lists the mints. A missing value is not zero.
getStrategies returns a union keyed by type: jupiter, dlmm, phoenix, or unreadable. An unreadable strategy carries the protocol and a reason. On current servers a dlmm strategy also carries inclusive lowerBinId and upperBinId, the pool’s activeBinId, and per-bin bins. These fields are optional in the type because older servers omit them.
getNavHistory returns posted NAVs, oldest first. Pass limit to ask for fewer points. A point with overridden: true was set by an admin nav_override, not by the keeper.
getRequests lists queued deposits and withdrawals. A request is pending until a later NAV epoch is posted, then resolvable. Deposit amount is in deposit-mint base units. Withdrawal shares is in share base units.
getNavHistory and getStrategyHistory throw an ApiError with the code HistoryUnavailable (HTTP 503) when the deployment has no history database.
realizedPnl is a signed base-unit string. It equals returned + feesRetained - contributed, so a loss is negative. A strategy with exact: false was opened before exact accounting existed, and its totals may be incomplete.

Phoenix

getPhoenix reports where the vault is in Phoenix setup. status is none (no strategy), registered (strategy exists, trader not onboarded), or ready (can deposit and trade). openOrders, withdrawable, and account are null when Phoenix’s own API is down. account is also null before onboarding. Handle null before you use them.

Quotes, tokens, and pools

getQuote asks Jupiter for a quote. amount is a base-unit string in the input mint’s units.
getToken resolves a pasted contract address to its symbol, decimals, and Jupiter verification. verified is null when verification is unknown. Warn the user before a swap that involves an unverified token.
searchPools finds DLMM pools that match a query such as a token symbol. getPool returns one pool with its activeBinId, which you need to choose the lowerBinId and exclusive upperBinId of a dlmm/open.
activePrice is token Y per token X, as a string.

Units and helpers

The SDK exports pure helpers that never touch the network. binRangeForPrices and binPrice take a PoolInfo-shaped argument with activeBinId, activePrice, and binStep. A PoolInfo from getPool fits. The constants DLMM_MAX_POSITION_BINS (1,400) and DLMM_BINS_PER_TRANSACTION (70) are also exported. One position account holds 70 bins, so a wider open becomes several transactions.