> For the complete documentation index, see [llms.txt](https://perena.gitbook.io/perena/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://perena.gitbook.io/perena/developers/vault-sdk.md). Agents can also search and read this documentation through its [MCP server](https://perena.gitbook.io/perena/~gitbook/mcp).

# Vault SDK

TypeScript client for the Perena vault program

`@perena/vault-sdk` is the TypeScript client for Perena Vault V2. One `VaultClient` wraps everything you need:

| Namespace                                               | What it does                                                                                          |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `client.pda`                                            | Derives vault, oracle, tranche-state, withdrawal-queue and fee PDAs                                   |
| `client.account`                                        | Fetches and decodes on-chain accounts (vault, tranche state, queues, oracle, incentives)              |
| `client.quote`                                          | Previews deposits and withdrawals, including fees and fee exemptions                                  |
| `client.tx`                                             | One transaction builder per program instruction. Each returns a plan you sign and send                |
| `client.sendTransaction` / `client.simulateTransaction` | Sign-and-send or simulate a plan with a Node keypair                                                  |
| Services                                                | Keeper logic (withdrawal queue fulfilment, consensus oracle, NAV crank, idle liquidity) for operators |
| Yield-tracker helpers                                   | Off-chain ledger calls for capital deployed outside the vault (curators only)                         |

## Pages

* [Getting started](https://perena.gitbook.io/perena/developers/vault-sdk/getting-started.md): install, create a client, environments, units
* [Reading vault state](https://perena.gitbook.io/perena/developers/vault-sdk/reading-vault-state.md): price, TVL, tranches, queues, holdings
* [Quotes](https://perena.gitbook.io/perena/developers/vault-sdk/quotes.md): preview what a deposit or withdrawal returns
* [Deposits and withdrawals](https://perena.gitbook.io/perena/developers/vault-sdk/deposits-and-withdrawals.md): USD\*, USD\*P, USD\*J flows, sync and async redemptions
* [Curator and operator functions](https://perena.gitbook.io/perena/developers/vault-sdk/curator-and-operator-functions.md): vault setup, NAV, capital deployment, risk controls, services

## Reference links

* [README with install and quick start](https://github.com/quineco/bankineco/blob/main/typescript/vault_sdk/README.md)
* [Operator and keeper scripts](https://github.com/quineco/bankineco/blob/main/typescript/vault_sdk/scripts/README.md)
* [How Vault V2 works](https://perena.gitbook.io/perena/protocol/perena-vault-v2.md) and the [For Partners](https://perena.gitbook.io/perena/protocol/perena-vault-v2/for-partners.md) integration guide
