Public API
Base URL: https://api.parchment.trade
Paths below are relative to the base URL. Each one also answers under the /api/parchment prefix, so /queue and /api/parchment/queue are the same endpoint.
The full reference is the API reference, built from the OpenAPI document at GET /openapi.json. The TypeScript SDK wraps most routes.
Conventions
- camelCase field names.
- Integers in JSON request and response bodies are strings with an
nsuffix:"10000000n", except stakingaccRewardPerShareandrewardDebt(u256 values as plain decimal strings). Parsenstrings as JavaScriptBigInt(drop then, or use the SDK). Cursors are opaque strings exceptGET /leaderboards'snextCursor, a u64nstring; pass its digits without thenback ascursor. - Two exceptions use other encodings.
POST /triggers/preparetakestakeProfitWad,stopLossWadandexpiresAtMsas plain decimal strings without then("78000000000000000000"), exactly as the trigger message signs them, and returnsexpiresAtMsthe same way; annsuffix there returns 400bad_request. InGET /markets/{id}/corporate-actions,leverageCapandpauseBeforeCloseMinutes(and each event'smaxLeverage) are JSON numbers, not strings. - Numeric query and path parameters (
limit, numericcursor,fromMs,toMs,nowMs,days, ids) use plain decimal numbers without then:?limit=10works;?limit=10nreturns 400. - Successful JSON response bodies are wrapped as
{ "data": ... }, exceptGET /openapi.json, which returns the OpenAPI document unwrapped. The field tables below describe the object insidedata. The SDK unwraps it for you. - Amounts are in base units (USDC has 6 decimals). Prices are 1e18 fixed-point integers.
- Previews are estimates at the current mid, not fills.
- There is no order book. Normal fills are at the oracle mid.
Routes
{owner} and {walletAddress} are wallet addresses.
| Area | Routes |
|---|---|
| Service | GET /config, GET /limits, GET /protocol, GET /openapi.json |
| Markets | GET /markets, GET /markets/{id}, GET /markets/stats, GET /markets/{id}/orderbook (one synthetic level at the mid), GET /markets/{id}/corporate-actions |
| Prices | GET /prices, GET /markets/{id}/prices |
| Candles | GET /markets/{id}/candles, GET /markets/candles (several markets) |
| Accounts | GET /accounts/{owner}, GET /accounts/{owner}/positions, GET /accounts/{owner}/history, GET /accounts/{owner}/equity, GET /positions/{id}, GET /positions/recent |
| Orders | GET /accounts/{owner}/orders, GET /orders/{orderId}, POST /orders/digest-hint |
| Previews | POST /previews/open, POST /previews/close |
| Transactions | POST /transactions/{action} (actions) |
| Triggers (TP/SL) | GET /accounts/{owner}/triggers, GET /accounts/{owner}/trigger-levels, POST /triggers, POST /triggers/prepare, POST /triggers/bind |
| Sponsor | POST /sponsor, POST /sponsor/execute |
| Payout queue and pool | GET /queue, GET /accounts/{walletAddress}/queue, GET /lp, GET /lp/queue |
| Staking | GET /staking, GET /staking/{owner} |
| Builders | GET /builders/{code}, GET /accounts/{walletAddress}/builder, GET /accounts/{walletAddress}/builders, GET /accounts/{walletAddress}/builder-allowance, GET /accounts/{accountId}/builder-approvals |
| Referrals | GET /referrals/{address}, GET /accounts/{walletAddress}/trading-referral |
| Game | GET /game/definitions, GET /game/{walletAddress}, GET /game/{walletAddress}/xp-ledger |
| Leaderboards and feeds | GET /leaderboards, GET /feed/whales, GET /feed/rekt, GET /cards/pnl |
| Stats | GET /stats/monitoring, GET /stats/activity, GET /stats/staking-history |
| Streams (Server-Sent Events) | GET /prices/stream, GET /trades/stream, GET /accounts/{owner}/orders/stream |
POST /sponsor sponsors gas for a session-key trade. POST /sponsor/execute executes a sponsored transaction with its signatures. POST /orders/digest-hint takes a request transaction's digest and hands its pending orders to the keeper. See Gas sponsorship.
Transaction actions
POST /transactions/{action} returns an unsigned transaction kind: txBytesBase64, commands (the Move calls) and note. Gas is not included. The body is the action's input; see the OpenAPI document.
| Area | Actions |
|---|---|
| Account | open-account, transfer-account, deposit, withdraw |
| Orders | request-open, request-close, cancel-order, expire-order, emergency-close, close-retired |
| Orders as a delegate | request-open-as-delegate, request-close-as-delegate, cancel-order-as-delegate, emergency-close-as-delegate, close-retired-as-delegate |
| Delegates | grant-delegate, revoke-delegate, grant-close-delegate, grant-session-and-trigger, revoke-session-and-trigger |
| Pool and queue | harvest, sweep-surplus, claim-pending-mint |
| Staking | stake, unstake, claim |
| Referrals | bind-referrer, bind-trading-referrer |
| Builder codes | create-builder, set-builder-fee, pause-builder, resume-builder, transfer-builder, set-builder-payout, approve-builder, revoke-builder-approval |
| Game | claim-daily, open-crate, open-crates, claim-quest, collect-mint |
| Locked PARCHMENT | release-unlocked, exit-early, exit-early-bounded |
| Admin | register-builder, set-builder-create-fee, install-treasury, auth-register, game-attach |
exit-early-bounded takes unlocks and maxPenalty. It exits exactly the quoted entries (pass the game profile's earlyExitUnlocks) and aborts on chain if it would forfeit more than maxPenalty (pass earlyExitPenaltyNow). Prefer it to exit-early, which exits every entry eligible when it executes.
liquidate, liquidate-retired and sweep answer 403 keeper_only, with no transaction. Liquidation is permissionless on chain, not through this API.
Payout queue
GET /queue
| Field | Meaning |
|---|---|
length | Claims in the queue |
totalOwed | Total owed to the queue |
lpCash | Pool cash, null while the exchange is not yet indexed |
instantlyPayable | What a payout run would pay right now, null while the exchange is not yet indexed |
owedToLpCashBps | totalOwed / lpCash in basis points, null when pool cash is 0 or unknown |
GET /accounts/{walletAddress}/queue
| Field | Meaning |
|---|---|
claims[] | Your queued claims in order: claimId, position (1-based place in the queue), owed, owedAhead |
queueLength, totalOwed, lpCash | Queue totals; lpCash is null while the exchange is not yet indexed |
Pool and staking
GET /lp includes stakerShareBps: the stakers' share of the next retained fee at current coverage, and the curve parameters stakerShareMinBps, stakerShareMaxBps, stakerCovLowBps, stakerCovHighBps.
GET /staking includes the PARCHMENT penalty payout to stakers: parchDripRemaining, parchDripNow, parchDripLastMs, parchDripEndMs.
Locked and vesting PARCHMENT
GET /game/{walletAddress}
| Field | Meaning |
|---|---|
lockedBalance | Everything held: in the lock, vesting, or vested and not yet released |
lockWindowBalance | Still in the 7-day lock |
nextUnlockMs | Next unlock time (ms), zero when none |
vestingBalance | Past the lock, not yet vested |
releasableNow | What a release pays now |
earlyExitPaidNow | What an early exit pays now |
earlyExitPenaltyNow | What an early exit forfeits to stakers now |
These fields are null unless lockedLedgerStatus is "current".
Transaction builders: POST /transactions/release-unlocked, POST /transactions/exit-early-bounded and POST /transactions/exit-early. All return unsigned transactions for your wallet to sign.