SDK architecture tour
The publicquant-desk-app/quantdesk-sdk repository is the developer-facing surface of QuantDesk: the on-chain interface, a typed client, and copy-paste examples. It is intentionally sterile — it contains what you need to integrate, and nothing about how the platform is operated internally.
This page walks the top-level tree so you know what you are looking at.
Repository layout
idl/ — the on-chain contract
The Interface Definition Language files describe the QuantDesk perpetuals program: its instructions, accounts, and types. They are the source of truth for anything that talks to the program directly on Solana.
| File | Purpose |
|---|---|
quantdesk_perp_dex.json | Machine-readable IDL for codegen and Anchor clients |
quantdesk_perp_dex.ts | Typed TypeScript export of the same IDL |
typescript/ — the client library
The published SDK package (@quantdesk/sdk) lives here. It wraps the IDL, REST gateway, and websocket streams behind a typed client.
| Path | Purpose |
|---|---|
src/client.ts | Main client entrypoint |
src/types.ts | Shared request/response and account types |
src/errors.ts | Typed error classes mapped to program/API errors |
src/idl.json | Bundled IDL used by the client |
utils/ | Helpers (including security utilities) |
tests/ | SDK unit and example test runners |
dist/ | Compiled output shipped to npm |
examples/ — runnable integrations
Self-contained samples grouped by task. Each subdirectory has its own README.md and works out of the box.
| Directory | What it shows |
|---|---|
devnet-testing/ | Service health checks, wallet funding, and program interaction on Solana devnet |
api-integration/ | Calling the public REST gateway for market data and monitoring |
typescript/ | Typed order flows — basic trading and advanced orders |
ai-integration/ | Feeding portfolio and sentiment context into your own agents |
examples/ (for example basic-trading-demo.js and community-trading-bot.ts) are quick, single-file starting points.
scripts/ — environment setup
Convenience scripts for standing up a local development environment (SVM testing, WSL setup, and analysis prep). They are optional — you do not need them to consume the published package, only to hack on the repo itself.
Where to go next
- Developer quickstart — health check, Swagger, first
curl - Building on QuantDesk —
place_order_v2on-chain tutorial - Contributing — submit your own strategy examples