Quickstart
Run the QSwap API and app on your machine, against Jupiter and Solana mainnet. About 5 minutes.
QSwap is two programs: the API in backend/ (a small proxy in front of Jupiter and a Solana RPC) and the app in
frontend/. You run both.
Browserlocalhost:3000
QSwap appfrontend/
NEXT_PUBLIC_API_URL
QSwap APIbackend/
Jupiterapi.jup.ag
Solana RPCmainnet-beta
QSwap API
$ cd backend && bun run devQSwap app
$ cd frontend && bun run devWithout JUPITER_API_KEY the API calls Jupiter keyless, at 0.5 requests per second: enough for a look, not for use.
Start the API
cd backend
cp .env.example .env # JUPITER_API_KEY, SOLANA_RPC_URL
bun install
bun run devGet a Jupiter API key at developers.jup.ag. Without one the API runs keyless at 0.5 requests per second.
Point the app at it
cd frontend
cp .env.example .env.local # NEXT_PUBLIC_API_URL = the API's address
bun installStart the app
# http://localhost:3000 → /swap
bun run devThis is mainnet
QSwap talks to Solana mainnet only. Quotes are free, but a swap you sign moves real funds. Try it with a small amount.
Env vars
The app reads one variable. Everything else (cluster, RPC URL, fees, slippage limits, feature flags) comes from
GET /config.
frontend/.env.local
- NEXT_PUBLIC_API_URLrequired
backend/.env
- SOLANA_RPC_URLrequired
- JUPITER_API_KEYoptional
- REFERRAL_ACCOUNToptional
- REFERRAL_FEE_BPS50–255optional
GET /config
Everything else, at runtime
Cluster · mainnet-betaRPC URL · /rpcSlippage · auto · max 50%Referral fee · 0Feature flags · 1
Source: .env.example · GET /config
Check your work
- 1Types
bun run typecheckAPI drift, wrong props - 2Lint
bun run lintHook misuse, dead code - 3Format
bun run format:checkStyle noise in diffs - 4Unit tests
bun run testBroken maths and rules - 5Build
bun run buildBroken pages and MDX
Source: package.json → scripts
bun run typecheck && bun run lint && bun run format:check && bun test && bun run build