Vault
Integrate Volo Vaults with the @naviprotocol/vault TypeScript SDK. List vaults, read positions and build deposit, withdrawal and cancellation transactions.
@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.
| Volo vaults | NAVI vaults | |
|---|---|---|
| Deposit | Creates a request that settles later | Settles in the same transaction |
| Withdraw | Returns request IDs; the asset arrives at settlement | Returns the withdrawn coin |
| Share price | Set when the operator executes the request | Known at execution |
| Cancel | Possible while pending, after a short lock | Not 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
| Function | Purpose |
|---|---|
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 / cancelPendingWithdrawPTB | Cancel 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
| Where | Unit |
|---|---|
depositPTB amount, withdrawPTB { kind: 'amount' } | Decimal string in coin units, such as '1.5' |
withdrawPTB { kind: 'shares' }, VaultPosition.shares | Raw share count |
minAmountOut | Raw base units, as bigint |
apy, apr | Decimal 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/sui2.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.