Skip to content
parchmentdocs
Open app

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 n suffix: "10000000n", except staking accRewardPerShare and rewardDebt (u256 values as plain decimal strings). Parse n strings as JavaScript BigInt (drop the n, or use the SDK). Cursors are opaque strings except GET /leaderboards's nextCursor, a u64 n string; pass its digits without the n back as cursor.
  • Two exceptions use other encodings. POST /triggers/prepare takes takeProfitWad, stopLossWad and expiresAtMs as plain decimal strings without the n ("78000000000000000000"), exactly as the trigger message signs them, and returns expiresAtMs the same way; an n suffix there returns 400 bad_request. In GET /markets/{id}/corporate-actions, leverageCap and pauseBeforeCloseMinutes (and each event's maxLeverage) are JSON numbers, not strings.
  • Numeric query and path parameters (limit, numeric cursor, fromMs, toMs, nowMs, days, ids) use plain decimal numbers without the n: ?limit=10 works; ?limit=10n returns 400.
  • Successful JSON response bodies are wrapped as { "data": ... }, except GET /openapi.json, which returns the OpenAPI document unwrapped. The field tables below describe the object inside data. 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.

AreaRoutes
ServiceGET /config, GET /limits, GET /protocol, GET /openapi.json
MarketsGET /markets, GET /markets/{id}, GET /markets/stats, GET /markets/{id}/orderbook (one synthetic level at the mid), GET /markets/{id}/corporate-actions
PricesGET /prices, GET /markets/{id}/prices
CandlesGET /markets/{id}/candles, GET /markets/candles (several markets)
AccountsGET /accounts/{owner}, GET /accounts/{owner}/positions, GET /accounts/{owner}/history, GET /accounts/{owner}/equity, GET /positions/{id}, GET /positions/recent
OrdersGET /accounts/{owner}/orders, GET /orders/{orderId}, POST /orders/digest-hint
PreviewsPOST /previews/open, POST /previews/close
TransactionsPOST /transactions/{action} (actions)
Triggers (TP/SL)GET /accounts/{owner}/triggers, GET /accounts/{owner}/trigger-levels, POST /triggers, POST /triggers/prepare, POST /triggers/bind
SponsorPOST /sponsor, POST /sponsor/execute
Payout queue and poolGET /queue, GET /accounts/{walletAddress}/queue, GET /lp, GET /lp/queue
StakingGET /staking, GET /staking/{owner}
BuildersGET /builders/{code}, GET /accounts/{walletAddress}/builder, GET /accounts/{walletAddress}/builders, GET /accounts/{walletAddress}/builder-allowance, GET /accounts/{accountId}/builder-approvals
ReferralsGET /referrals/{address}, GET /accounts/{walletAddress}/trading-referral
GameGET /game/definitions, GET /game/{walletAddress}, GET /game/{walletAddress}/xp-ledger
Leaderboards and feedsGET /leaderboards, GET /feed/whales, GET /feed/rekt, GET /cards/pnl
StatsGET /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.

AreaActions
Accountopen-account, transfer-account, deposit, withdraw
Ordersrequest-open, request-close, cancel-order, expire-order, emergency-close, close-retired
Orders as a delegaterequest-open-as-delegate, request-close-as-delegate, cancel-order-as-delegate, emergency-close-as-delegate, close-retired-as-delegate
Delegatesgrant-delegate, revoke-delegate, grant-close-delegate, grant-session-and-trigger, revoke-session-and-trigger
Pool and queueharvest, sweep-surplus, claim-pending-mint
Stakingstake, unstake, claim
Referralsbind-referrer, bind-trading-referrer
Builder codescreate-builder, set-builder-fee, pause-builder, resume-builder, transfer-builder, set-builder-payout, approve-builder, revoke-builder-approval
Gameclaim-daily, open-crate, open-crates, claim-quest, collect-mint
Locked PARCHMENTrelease-unlocked, exit-early, exit-early-bounded
Adminregister-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

FieldMeaning
lengthClaims in the queue
totalOwedTotal owed to the queue
lpCashPool cash, null while the exchange is not yet indexed
instantlyPayableWhat a payout run would pay right now, null while the exchange is not yet indexed
owedToLpCashBpstotalOwed / lpCash in basis points, null when pool cash is 0 or unknown

GET /accounts/{walletAddress}/queue

FieldMeaning
claims[]Your queued claims in order: claimId, position (1-based place in the queue), owed, owedAhead
queueLength, totalOwed, lpCashQueue 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}

FieldMeaning
lockedBalanceEverything held: in the lock, vesting, or vested and not yet released
lockWindowBalanceStill in the 7-day lock
nextUnlockMsNext unlock time (ms), zero when none
vestingBalancePast the lock, not yet vested
releasableNowWhat a release pays now
earlyExitPaidNowWhat an early exit pays now
earlyExitPenaltyNowWhat 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.