Skip to main content
This quickstart walks through cloning the repo, building the programs, launching the frontend against devnet, and running the end-to-end script that touches every program.

Prerequisites

1

Install toolchain

You need Rust, the Solana CLI, and Anchor.
# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Solana
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"

# Anchor
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
avm install latest && avm use latest
2

Fund a devnet wallet

solana config set --url devnet
solana-keygen new --outfile ~/.config/solana/id.json
solana airdrop 2

Clone and build

git clone https://github.com/kimia-protocol/kimia.git
cd kimia
The repo has three workspaces:
kimia/
├── Perp-engine/   # kimia-perp Anchor program + perps-math / perps-common crates
├── Programs/      # delta-vault, intent-router, yield-amm, split-engine, kusd-mint
└── frontend/      # Next.js 16 app (app/, codama clients, wallet)
Build every Anchor program:
cd Perp-engine && anchor build && cd ..
cd Programs    && anchor build && cd ..

Run the devnet end-to-end

The Programs/ workspace ships a single script that:
  1. Initializes the perp market and orderbook
  2. Seeds the spot pool with USDC/wSOL
  3. Initializes the delta-vault, opens a hedged position
  4. Creates a split-engine market (PT + YT)
  5. Creates a yield-AMM pool and swaps YT for underlying
cd Programs
npm install
npx ts-node tests/devnet-e2e.ts
The script is idempotent, re-running it skips initialized accounts.

Launch the frontend

cd frontend
npm install
npm run setup    # builds Anchor vault + regenerates all Codama clients
npm run dev
Open http://localhost:3000, connect a wallet, pick devnet in the cluster switcher, and you’ll see:
RouteWhat it exposes
/Perp trading, TradingView chart, orderbook, order form, positions
/vaultsDeposit / withdraw / claim funding on the delta-vault
/earnBuy PT, claim yield, redeem at maturity
/yield-ammAdd / remove LP, swap PT ↔ underlying
/intentFixed-rate lock flow across the full stack
/kusdMint / redeem kUSD, stake for yield

Regenerate clients after a program change

Every program has a Codama config that targets its IDL. After you edit Rust:
cd frontend
npm run codama:all
This rewrites TypeScript clients under app/generated/<program>/, instructions, accounts, and PDA helpers, all typed against @solana/kit.

What next?

Architecture

See the CPI graph between the six programs.

Program reference

Instructions, accounts, and error codes per program.