Skip to main content
Kimia is a set of permissionless Anchor programs with deterministic PDAs. Integrating does not require permission, an API key, or a keeper whitelist.
Kimia does not publish an npm package or a crates.io crate. There is no @kimia/sdk you can npm install. Everything below assumes you either:
  • Fork this repo and import the generated TS clients directly, or
  • Regenerate TS clients from the on-chain IDLs into your own project.
CPI from another Solana program works but requires a path or git Cargo dependency — no published crate.

What actually ships

SurfaceWhere it livesHow you use it
Anchor IDLsPerp-engine/target/idl/, Programs/target/idl/Build the workspaces, then point any IDL-aware tool at the JSON
Codama-generated TS clientsfrontend/app/generated/<program>/Copy the folder into your project (only dep is @solana/kit)
Rust program cratesPerp-engine/programs/kimia-perp, Programs/programs/*Cargo path/git dependency with features = ["cpi"]
Reference UI codefrontend/app/**Read for wiring examples (send helper, matching, PDA derivation)

Choose your integration path

TypeScript via Codama

Copy frontend/app/generated/<program>/ into your project. Only runtime dep is @solana/kit.

Regenerate from IDL

If you want the TS client in your own package, re-run Codama against the IDLs under target/idl/.

On-chain CPI

Depend on the program crate by path or git with features = ["cpi"]. Reference: Programs/programs/delta-vault/src/instructions/deposit.rs.

Keeper bot

Crank funding, liquidations, rewards, rebalancing — permissionlessly.

Source IDLs

After building the Anchor workspaces with anchor build:
Perp-engine/target/idl/kimia_perp.json
Programs/target/idl/delta_vault.json
Programs/target/idl/split_engine.json
Programs/target/idl/yield_amm.json
Programs/target/idl/intent_router.json
Programs/target/idl/kusd_mint.json
Each codama.*.json in frontend/ pins one IDL to an output directory:
{
  "idl": "../Perp-engine/target/idl/kimia_perp.json",
  "outDir": "./app/generated/perp",
  "programName": "kimiaPerp"
}

Typical wiring (inside this repo)

1

Build programs, regenerate clients

From the Perp-engine and Programs workspaces: anchor build. Then from frontend/: npm run codama:all.
2

Import the generated builder

import { getPlaceOrderInstruction } from '@/app/generated/perp/instructions';
3

Resolve PDAs

Use the generated find*Pda helpers; they encapsulate seed derivation.
4

Prepend an oracle update

Use @pythnetwork/pyth-solana-receiver to post a fresh Hermes update in the same transaction.
5

Sign and send

The reference sender lives at frontend/app/lib/send-transaction.ts.

Next

Generated client shape

What Codama output looks like.

Data formats & precision

Decimals, rounding, BigInt.

Error handling

Map program errors to user messages.