The terminal, as an API.
Swaps, limit and DCA orders, SOL-PERP leverage, lending and liquidity — the same engine the terminal runs on, driven from your own bot or agent. Non-custodial by construction: every build endpoint returns a transaction your wallet has not signed, your key signs locally, and a leaked API key can never move funds.
# 0 · who am I? proves the key + names its wallet, scopes, limits
curl -s https://www.prizm.trading/api/v1/key -H "Authorization: Bearer $PZK"
# 1 · build — unsigned, fee already inside the transaction
curl -s https://www.prizm.trading/api/v1/swap/build \
-H "Authorization: Bearer $PZK" -H "content-type: application/json" \
-d '{"inputMint":"So11111111111111111111111111111111111111112",
"outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountBase":"10000000"}'
# → { txBase64, lastValidBlockHeight, quote, fee, signer }
# 2 · sign LOCALLY (your key never leaves your machine) — @solana/web3.js
const tx = VersionedTransaction.deserialize(Buffer.from(b64, "base64"));
tx.sign([keypair]);
const SIGNED = Buffer.from(tx.serialize()).toString("base64");
# 3 · broadcast · signature verified, sent, rebroadcast every ~2 s for up to 25 s
curl -s https://www.prizm.trading/api/v1/execute \
-H "Authorization: Bearer $PZK" -H "content-type: application/json" \
-d '{"txBase64":"'"$SIGNED"'"}'
# → { signature, status: "confirmed" | "finalized", slot }
# or { signature, status: "pending", blockHeight, resolveWith } → poll GET /tx/{signature}Any agent · one paste
It discovers everything else itself.
Integrate PRIZM for me. Start from https://www.prizm.trading/llms.txt and use my API key: pzk_…
Claude Code · just ask
It reads /llms.txt and can wire the MCP server with the command below.
Connect to prizm.trading and set up my trading integration. My API key: pzk_…
https://www.prizm.trading/api/v1Authorization: Bearer pzk_…Fixed windows from the first call; quotes and every orders action count as trading. Backstops: 600/min per IP on REST, 240 messages/min per IP on MCP.
Build, sign, execute.
Call an endpoint. It returns a transaction your wallet has not signed — fee payer set, fee already inside.
Deserialize and sign locally with the wallet's key. PRIZM never sees it; a key alone cannot move funds.
POST the signed bytes to /execute — it verifies your signature, broadcasts, rebroadcasts every ~2 s for up to 25 s, and answers confirmed, finalized, failed or pending. A pending is resolved with GET /tx/{signature}, never by rebuilding.
Twenty endpoints, one contract.
| Method | Endpoint | Scope | What it does |
|---|---|---|---|
| GET | /key | any | Key introspection · call this first. |
| GET | /markets | read | The curated top-150 catalog · symbols, mints and decimals. Swaps and orders accept any mint pair. |
| GET | /prices?ids=<mint>,<mint> | read | Spot USD prices, 1-50 mints · a non-mint entry is refused by name, never dropped. |
| GET | /balances | read | SOL + token holdings · size orders from this (8 s cache). |
| GET | /defi/pools | read | Meteora DLMM pools · feeds /defi/build. |
| GET | /positions | read | Your live SOL-PERP positions. |
| GET | /defi/rates | read | Kamino supply / borrow APY, marginfi supply APR (uncompounded · not comparable), jitoSOL stake APY, and the fee bps charged. |
| GET | /defi/positions | read | Your Kamino (main market) + marginfi positions · supplied and borrowed, each valued by the venue's own oracle. |
| GET | /signals?tf=5m | read | VIZION · next-bar lean (never tradeable · it measures the feed catching up), forming-bar call, reach band · each with measured accuracy + fee economics, plus the climax call; gate on health.ok. |
| GET | /climax?symbol=SOLUSDT | read | The climax rule's live view · whether a call is issued right now, and every input it decides on. SOLUSDT only. |
| GET | /feeds/{name}?n=<readings> | read | Operator-pushed feeds (exchange positioning, liquidation watch) · latest reading and the n most recent pushes (1-300), one per push. |
| GET | /vizion | read | VIZION's recall · the last 40 completed bars against six years of windows, what followed the closest, and its measured accuracy. |
| POST | /swap/quote{ inputMint, outputMint, amountBase, slippageBps? } | trade | Quote a swap · the fee is carved out of amountBase · slippageBps 1-5000, default 50. |
| POST | /swap/build{ inputMint, outputMint, amountBase, slippageBps? } | trade | Quote + build a swap for your wallet to sign · allowlist verified server-side · returns lastValidBlockHeight. |
| POST | /orders{ kind, action, … } | trade | Limit & DCA · create / cancel / list. The fee is added on top at placement; DCA 2-1000 fills, 60 s-90 d apart. |
| POST | /perps/build{ action, side, collateralSol, sizeUsd } | perps | Open / close a SOL-PERP · long or short, up to 100x. Opens are region-gated; closes never are (entirePosition or sizeUsdDelta). |
| POST | /lev{ action, side, collateralUi, leverage, … } | defi | Leveraged SOL/USDC spot on Kamino · venue, position, setup, open / close, atomic or loop (loop actions return an ordered list of legs). |
| POST | /defi/build{ venue, action, … } | defi | Kamino / marginfi / Meteora · deposit, withdraw; Kamino borrow (region-gated) and repay. A Meteora withdraw closes the whole position. |
| POST | /execute{ txBase64 } | trade|perps|defi | Broadcast your signed transaction · any trading scope. Answers confirmed, finalized, failed or pending; a pending is resolved below, never by rebuilding. A transaction that can never land — an empty co-signer slot, or a blockhash already expired — is refused 400 up front rather than polled. |
| GET | /tx/{signature} | any | Where a broadcast stands · poll this after a pending /execute; a rebuild is safe only once blockHeight passes the lastValidBlockHeight every build returns. |
GET /keyIt proves the key is live and returns its wallet, scopes and rate ceilings — a dead key surfaces on call one, not as a wall of 401s later.
{ error: { code, message } }Always that envelope, with a matching HTTP status. Auth is checked before argument validation.
Flat fees, inside the transaction.
Each fee is a single transfer to the treasury riding the same atomic transaction it belongs to — you can read it in the transaction before you sign, and a transaction that fails pays nothing. The API charges exactly what the terminal charges, and the per-call fee figure on every quote and build is authoritative for the wallet in hand: fee on swaps and orders, feeLamports on perps, feeBps / feeUi on DeFi, and feeBps per leg on /lev.
Point your agent at prizm.trading. It figures out the rest.
Everything an agent needs is published by convention — the discovery kit below plus /llms.txt. All it needs from you is one API key.
/openapi.json/.well-known/ai-plugin.json/.well-known/agent.json/api/mcp{
"mcpServers": {
"prizm": {
"type": "http",
"url": "https://www.prizm.trading/api/mcp",
"headers": { "Authorization": "Bearer pzk_…" }
}
}
}Sixteen MCP tools cover the REST surface: key introspection, balances, market data, prices, pools, positions, lending rates and positions, signals, swap quote and build, limit & DCA orders, SOL-PERP, DeFi, the broadcast lane, and the signature resolver a pending broadcast is followed up with. Leveraged spot (/lev), VIZION's recall, the climax view and the operator feeds are REST-only. Build tools return transactions your signer has not signed — the protocol handshake and the tool catalog are open, so a client can plan the whole integration before it authenticates. Errors: a missing or unusable key is an HTTP 401 JSON-RPC error (-32001), an unknown tool is -32602, a rate limit is 429 (-32000 with retryAfterSec), and a tool that ran and refused is a normal result with isError true carrying the same { error: { code, message } } envelope as REST.
initialize → tools/list → tools/call · JSON-RPC 2.0 over plain POST, stateless, spec revision 2025-06-18.
Non-custodial, and provably so.
- Every transaction is built for the key's own wallet only, and returned without the wallet's signature (a Meteora deposit carries only the throwaway position key's signature).
- /execute broadcasts only transactions your wallet signed — it is never an open relay.
- A 503 maintenance (with Retry-After) means the operator has paused NEW exposure — quotes, swap builds, order and perp opens, deposits and borrows. Closes, cancels, withdrawals, repayments and /execute stay open throughout, so a position can always be exited.
- Every 429 carries Retry-After; every 5xx body carries error.ref, the request id to quote when reporting one.
- Keys are stored as a one-way hash plus a six-character preview, shown once, and revoke globally within thirty seconds.
- Each key carries a scope set (read / trade / perps / defi) — a key minted on the wallet page carries all four; a narrower set is chosen with the signed key-management request — bound to one wallet (up to five keys per wallet), and rate-limited per minute and per day, with an IP backstop.
- Perps opens, leveraged opens and Kamino borrows carry the same fail-closed regional gating as the terminal (wallets the operator designates for testing and operation, including its own, are judged on identity rather than country on keyed requests); closes and repays are never gated, so a position can always be exited.
- Every fee rides inside the transaction you sign — a transaction that fails pays nothing.
The request model on perps means the worst case is a refund of the collateral — a keeper fills your request or returns the collateral; the platform fee on an open is paid with the request and is not refunded. Every error is a JSON envelope of the shape { error: { code, message } } with a matching HTTP status.
