For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Start

Read the vault's state and call it from your own code.

The vault is a singleton, deployed and initialized by the Keystone admin. You don't stand one up yourself — you point a client at the existing program and read or transact against it.


Prerequisites

Only Node.js 20+ is needed to build against the vault. The Rust and Anchor toolchain below is for compiling the program from source, which you only need if you're reviewing or modifying it.

Tool
Version
Needed for

Node.js

20+

Client integration

Rust

1.79+ (rustup-managed)

Building the program

Anchor CLI

0.32.1+

Building the program / IDL

Solana CLI

1.18+

Building the program

git clone https://github.com/kamwithak/keystone-contracts.git
cd keystone-contracts
npm install

Program ID

Network
Program ID

Devnet

E7tpCcxtvuTXLAckBGWb1AsndpLQ1Y9hQA3iGYSXz2vJ

Mainnet

pending audit

  • Single Anchor program: keystone_finance

  • Implements the ksUSD vault end-to-end

  • 27 instructions · 42 errors · 25 events · 2 account types


Build

  • IDL: the generated IDL — regenerated to match latest source

  • TS types: the generated TypeScript types — derived from the IDL


What you can call

Anyone can call these, and they're the whole surface most integrations need:

Instruction
Does

deposit(usdc_amount)

USDC in, ksUSD out at the current share price

withdraw_instant(shares)

ksUSD in, USDC out of the liquidity buffer

request_withdrawal(shares) + process_withdrawal()

Queued path for withdrawals larger than the buffer

Position management (open_position, close_position, attest_nav, the lending cranks) is gated to the vault's authorized keeper. settle, process_withdrawal, and emergency_close need no permission at all. Full list in the instructions reference.


TypeScript client


Last updated