What actually ships
| Surface | Where it lives | How you use it |
|---|---|---|
| Anchor IDLs | Perp-engine/target/idl/, Programs/target/idl/ | Build the workspaces, then point any IDL-aware tool at the JSON |
| Codama-generated TS clients | frontend/app/generated/<program>/ | Copy the folder into your project (only dep is @solana/kit) |
| Rust program crates | Perp-engine/programs/kimia-perp, Programs/programs/* | Cargo path/git dependency with features = ["cpi"] |
| Reference UI code | frontend/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 withanchor build:
codama.*.json in frontend/ pins one IDL to an output directory:
Typical wiring (inside this repo)
Build programs, regenerate clients
From the Perp-engine and Programs workspaces:
anchor build.
Then from frontend/: npm run codama:all.Prepend an oracle update
Use
@pythnetwork/pyth-solana-receiver to post a fresh Hermes update in the
same transaction.Next
Generated client shape
What Codama output looks like.
Data formats & precision
Decimals, rounding, BigInt.
Error handling
Map program errors to user messages.

