Skip to content
Docs
Open app
Skip to Content

Vault

Integrate Volo Vaults with the @naviprotocol/vault TypeScript SDK. List vaults, read positions and build deposit, withdrawal and cancellation transactions.

  • @naviprotocol/vault 0.1.0
  • @mysten/sui 2.39.1npm 3.0.1
  • TypeScript, ESM
  • Sui mainnet

@naviprotocol/vault is the TypeScript SDK for Volo Vaults and NAVI vaults on Sui. It finds vaults, reads positions and builds deposit, withdrawal and cancellation transactions as programmable transaction blocks (PTBs). Your application signs them with the user’s wallet; the SDK never signs or executes anything.

How a Volo vault settles

Volo vaults are request-based. A deposit or withdrawal creates a request on the vault, and an operator executes pending requests together during the vault’s settlement window.

PTB from depositPTB orwithdrawPTBsigned transaction creates arequestsettle requests in thewindowshares to the receipt, or theasset to the ownerpending: cancellableafter a short lockYour appUser walletVolo vaultVault operatorYour appUser walletVolo vaultVault operator
PTB fromdepositPTBorwithdrawPTBsignedtransactioncreates arequestsettlerequests inthe windowshares tothereceipt,or theasset tothe ownerpending:cancellableafter ashortlockYourappUserwalletVolovaultVaultoperatorYourappUserwalletVolovaultVaultoperator
Volo vaultsNAVI vaults
DepositCreates a request that settles laterSettles in the same transaction
WithdrawReturns request IDs; the asset arrives at settlementReturns the withdrawn coin
Share priceSet when the operator executes the requestKnown at execution
CancelPossible while pending, after a short lockNot applicable

Each position is a number of vault shares recorded against a receipt object in the user’s wallet. A wallet can hold several receipts for one vault, and the SDK spreads deposits and withdrawals across them. The vault operations reference shows the Move calls and events behind each step, and how a deposit request settles explains it from the user’s side.

Branch on source, filter on protocol

Every vault has a source ('navi' | 'volo'), which decides the code path and Move package, and a protocol ('navi' | 'volo' | 'astros'), which only labels the strategy provider. They can differ: on mainnet, SUI LST NAVI SINGLE LOOP is a Volo-source vault with protocol: 'navi'. Always branch on source.

Core functions

FunctionPurpose
getVaults(options?) / getVault(id)List vaults, or load one, from the NAVI open API.
getPositions(owner, options?)The owner’s shares and estimated balance in each vault.
depositPTB(tx, vault, owner, amount, options?)Add a deposit to tx. For Volo vaults it returns { receipt, requestId }.
withdrawPTB(tx, vault, owner, target, options?)Add a withdrawal. For Volo vaults it returns { requestIds }.
getPendingRequests(owner, options?)Deposits and withdrawals waiting for settlement.
cancelPendingDepositPTB / cancelPendingWithdrawPTBCancel a pending request.
isVaultSdkError(error)Narrow an error to VaultSdkError and read its stable code.

Full signatures and the lower-level volo.* builders are in the SDK reference and TypeDoc.

Units

WhereUnit
depositPTB amount, withdrawPTB { kind: 'amount' }Decimal string in coin units, such as '1.5'
withdrawPTB { kind: 'shares' }, VaultPosition.sharesRaw share count
minAmountOutRaw base units, as bigint
apy, aprDecimal fraction: 0.0807 is 8.07%

Using an AI coding agent?

Install the NAVI SDK skill, which includes the vault sub-skill for @naviprotocol/vault: npx skills add naviprotocol/skills --skill navi-sdk.

Requirements

  • @mysten/sui 2.16 or later as a peer dependency. The examples use 2.39.1 with the gRPC client.
  • An ES module environment: Node.js with "type": "module" or a bundler.
  • No API key.

On this page