Protocol
Config, protocol summary, and API limits
Config
/configResponses
Package ids, object ids, storage type, and feed pins, as public camelCase JSON. basePackageId(s), gamePackageId(s) and mintPackageId(s) are the split packages (original first, latest last; empty when the service does not serve them). Every integer is an n-suffixed decimal string ("5000000n"). maxPendingOrders is the admin-set per-account cap on pending two-step opens (the contract default "64n" until the service has indexed the config). Compare an account's pendingOpenOrders with maxPendingOrders before a request-open: a request-open while pendingOpenOrders >= maxPendingOrders aborts order::ETooManyOrders; closes are never capped. Older services omit it. trim is the global close-preview trim { maxShareBps, cPpm, source: indexed|default } (n-suffixed decimal strings; applies to every market; source is default until the service has indexed the config); older services omit it.
application/json
dataConfigrequiredThe public service configuration.
basePackageIdstring | nullLatest base package id (null until configured). Type tags use the first of
basePackageIds.Pattern^0x[0-9a-f]{64}$Example0x63e4c0750101534f8ac9187e6e7b1fd2d1b4e364e141dc26e0ccb60f5176de9dbasePackageIdsstring[]requiredEvery
parchment_baseversion, original first.buildersBuilderConfigrequiredconfigIdstring | nullPattern^0x[0-9a-f]{64}$Example0xd3130ac108d621be0d73cb8f130ea4dca14f52512c4d06bf48610067098e93e1exchangeIdstring | nullPattern^0x[0-9a-f]{64}$Example0x2e53756af142bc2768c9bae0d2acae16558e68ab11dc71987dbfc96e4dd40819gamePackageIdstring | nullLatest
parchment_gameid;game_eventsandgame_booktypes use the original id.Pattern^0x[0-9a-f]{64}$Example0x29a65f44f54483f8675b3b19a048e66a163977af77a7e545ddabc8d6b1a9ed71gamePackageIdsstring[]requiredgameRewardsGameRewardsrequiredgraphqlUrlstringrequiredmaxPendingOrdersstringrequiredThe per-account pending open order cap. The service uses 64 until config is indexed; indexed admin values take precedence.
Pattern^-?(0|[1-9][0-9]*)n$Example24nmintPackageIdstring | nullLatest
parchment_mintid;locked_mintandmint_captypes use the original id.Pattern^0x[0-9a-f]{64}$Example0x9556fe18f66c066edbb2f504afc2c82a1edade7d81fcd9136e529dad565f2235mintPackageIdsstring[]requiredoraclePackageIdstring | nullPattern^0x[0-9a-f]{64}$Example0x267f963332073dc80eb7aba86e7e47a2200dea686684c98d4bc87822465f81a9packageIdstring | nullPattern^0x[0-9a-f]{64}$Example0x70fcdf24c8937202fe8fdc5b9fccfe62439ca58fdd2b7b0f077325a611261939packageIdsstring[]requiredpauseMaskstringrequiredPause flags bitmask, one bit per pause category.
Pattern^-?(0|[1-9][0-9]*)n$Example0npinsConfigPin[]requiredproofTtlMsstring | nullMilliseconds.
Pattern^(0|[1-9][0-9]*)n$Example60000nrandomIdstring | nullPattern^0x[0-9a-f]{64}$Example0x65068926e2b7ccdde582818e77fdc59297a7b3b4f2b8f3deb05373e411b69afdrefereeDiscountBpsstringrequiredBasis points (1/10000).
Pattern^-?(0|[1-9][0-9]*)n$Example2000nreferralEnabledbooleanrequiredreferralSourcestringrequiredWhere a config value comes from.
One ofindexeddefaultregistryIdstring | nullPattern^0x[0-9a-f]{64}$Example0x4399cf463f722e69fa1a3b4c2ef486425ad6cd388722813ab994d9548edd6205rewardCoinTypestring | nullExample0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDCstakingPoolIdstring | nullPattern^0x[0-9a-f]{64}$Example0xd49df5e14280365fd33dc1673cf6725601f811af209fd316b4a152f704ddf409storageTypestringrequiredtokenPackageIdstring | nullPattern^0x[0-9a-f]{64}$Example0xd97802de3066eae5235d901ceb5fad724675c3fb0cb921dee4f047a9b0815c5dtradePackageIdstring | nullPattern^0x[0-9a-f]{64}$Example0x101304235b64d3aed1b96eaffabf2768f7df54366ac9c6cb15d8934898c11ca9tradePackageIdsstring[]requiredtriggerDelegatestring | nullPattern^0x[0-9a-f]{64}$Example0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0dtriggersLiveboolean | nulltriggersPackageIdstring | nullLatest
parchment_triggersid (on-chain TP/SL commitment calls), omitted until deployed; from the service's split-packages route.Pattern^0x[0-9a-f]{64}$Example0xfd69a144c9ae4dc7a492a80dcec01f16a27aecb4cfc7580efb9bac24e77d65e9triggersPackageIdsstring[]trimConfigTrimrequiredLive profit-trim knobs, global to every market.
usdcTypestringrequiredExample0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC
Example request
curl 'https://api.parchment.trade/config'const res = await fetch("https://api.parchment.trade/config");
const { data } = await res.json();Example response (200)
{
"data": {
"basePackageId": "0x63e4c0750101534f8ac9187e6e7b1fd2d1b4e364e141dc26e0ccb60f5176de9d",
"basePackageIds": [
"0x63e4c0750101534f8ac9187e6e7b1fd2d1b4e364e141dc26e0ccb60f5176de9d"
],
"builders": {
"createFee": "800000n",
"enabled": true,
"hardCapBps": "2000n",
"maxFeeBps": "8n",
"ownerFeeLimitBps": "2000n"
},
"configId": "0xd3130ac108d621be0d73cb8f130ea4dca14f52512c4d06bf48610067098e93e1",
"exchangeId": "0x2e53756af142bc2768c9bae0d2acae16558e68ab11dc71987dbfc96e4dd40819",
"gamePackageId": "0x29a65f44f54483f8675b3b19a048e66a163977af77a7e545ddabc8d6b1a9ed71",
"gamePackageIds": [
"0x29a65f44f54483f8675b3b19a048e66a163977af77a7e545ddabc8d6b1a9ed71"
],
"gameRewards": {
"achievementMintFractionBps": "2000n",
"dailyDrop": {
"base": "100000000n",
"max": "100000000n",
"step": "3n",
"streakCap": "3n"
},
"dailyDropUnit": "XP",
"decimals": "9n",
"globalMintCapPerDay": "1500000000000n",
"model": "minted",
"note": "string",
"treasuryInstalled": true,
"walletMintCapPerDay": "1500000000000n",
"winMint": "1500000000000n"
},
"graphqlUrl": "string",
"maxPendingOrders": "24n",
"mintPackageId": "0x9556fe18f66c066edbb2f504afc2c82a1edade7d81fcd9136e529dad565f2235",
"mintPackageIds": [
"0x9556fe18f66c066edbb2f504afc2c82a1edade7d81fcd9136e529dad565f2235"
],
"oraclePackageId": "0x267f963332073dc80eb7aba86e7e47a2200dea686684c98d4bc87822465f81a9",
"packageId": "0x70fcdf24c8937202fe8fdc5b9fccfe62439ca58fdd2b7b0f077325a611261939",
"packageIds": [
"0x70fcdf24c8937202fe8fdc5b9fccfe62439ca58fdd2b7b0f077325a611261939"
],
"pauseMask": "0n",
"pins": [
{
"lazerFeedId": "1398n",
"sourceId": "2n",
"storageId": "0x36d5377cee4c4a61087f999a9c137472ab8daa75ce225ec82d9e5f4ac1fb12bd",
"symbol": "WTI"
}
],
"proofTtlMs": "60000n",
"randomId": "0x65068926e2b7ccdde582818e77fdc59297a7b3b4f2b8f3deb05373e411b69afd",
"refereeDiscountBps": "2000n",
"referralEnabled": true,
"referralSource": "indexed",
"registryId": "0x4399cf463f722e69fa1a3b4c2ef486425ad6cd388722813ab994d9548edd6205",
"rewardCoinType": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
"stakingPoolId": "0xd49df5e14280365fd33dc1673cf6725601f811af209fd316b4a152f704ddf409",
"storageType": "string",
"tokenPackageId": "0xd97802de3066eae5235d901ceb5fad724675c3fb0cb921dee4f047a9b0815c5d",
"tradePackageId": "0x101304235b64d3aed1b96eaffabf2768f7df54366ac9c6cb15d8934898c11ca9",
"tradePackageIds": [
"0x101304235b64d3aed1b96eaffabf2768f7df54366ac9c6cb15d8934898c11ca9"
],
"triggerDelegate": "0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d",
"triggersLive": true,
"triggersPackageId": "0xfd69a144c9ae4dc7a492a80dcec01f16a27aecb4cfc7580efb9bac24e77d65e9",
"triggersPackageIds": [
"0xfd69a144c9ae4dc7a492a80dcec01f16a27aecb4cfc7580efb9bac24e77d65e9"
],
"trim": {
"cPpm": "1000n",
"maxShareBps": "2000n",
"source": "indexed"
},
"usdcType": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"
}
}API limits
/limitsResponses
Limits this API preserves. Settlement prices come only from the pinned on-chain price storage.
application/json
dataLimitsrequiredincomingTxKindstringrequiredmoveAbortCatalogstringrequiredorderBookstringrequiredorderTxNotestringrequiredpriceFeedStorageGetterstringrequiredpriceUnavailablestringrequiredreferralBonusesstringrequiredreferralEstimatestringrequiredsignedAuthstringrequiredsponsorstringrequiredPattern^0x[0-9a-f]{64}$Example0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0dtradeTransactionsstringrequiredtradeTxNotestringrequired
Example request
curl 'https://api.parchment.trade/limits'const res = await fetch("https://api.parchment.trade/limits");
const { data } = await res.json();Example response (200)
{
"data": {
"incomingTxKind": "string",
"moveAbortCatalog": "string",
"orderBook": "string",
"orderTxNote": "string",
"priceFeedStorageGetter": "string",
"priceUnavailable": "string",
"referralBonuses": "string",
"referralEstimate": "string",
"signedAuth": "string",
"sponsor": "0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d",
"tradeTransactions": "string",
"tradeTxNote": "string"
}
}LP payout queue
/lp/queueResponses
LP vault payout queue: length, total owed, LP cash, head and claims.
application/json
dataLpQueuerequiredclaimsClaim[]requiredThe first queued claims in FIFO order, at most 200.
headnull | ClaimlpCashstring | nullPattern^-?(0|[1-9][0-9]*)n$Example1850000000000nqueueLengthstringrequiredPattern^-?(0|[1-9][0-9]*)n$Example24ntotalOwedstringrequiredPattern^-?(0|[1-9][0-9]*)n$Example1850000000000n
Example request
curl 'https://api.parchment.trade/lp/queue'const res = await fetch("https://api.parchment.trade/lp/queue");
const { data } = await res.json();Example response (200)
{
"data": {
"claims": [
{
"accountId": "0xad23e722f3542ae36c276c1b303e30ae77c840a84db89c7215fa87bf92006691",
"claimId": "5531n",
"enqueuedTx": "string",
"feeRemaining": "800000n",
"harvestedTx": "string",
"net": "100000000n",
"onTopRemaining": "800000n",
"owner": "0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d",
"positionId": "1042n",
"remaining": "100000000n",
"status": "queued",
"timestampMs": "1796677200000n"
}
],
"head": {
"accountId": "0xad23e722f3542ae36c276c1b303e30ae77c840a84db89c7215fa87bf92006691",
"claimId": "5531n",
"enqueuedTx": "string",
"feeRemaining": "800000n",
"harvestedTx": "string",
"net": "100000000n",
"onTopRemaining": "800000n",
"owner": "0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d",
"positionId": "1042n",
"remaining": "100000000n",
"status": "queued",
"timestampMs": "1796677200000n"
},
"lpCash": "1850000000000n",
"queueLength": "24n",
"totalOwed": "1850000000000n"
}
}OpenAPI document
/openapi.jsonResponses
application/json
object
Example request
curl 'https://api.parchment.trade/openapi.json'const res = await fetch("https://api.parchment.trade/openapi.json");
const { data } = await res.json();Example response (200)
{}Recent positions
/positions/recentQuery parameters
limitstringPage size: canonical decimal (digits only, no sign, whitespace or leading zero), 1 to 18446744073709551615, else 400 bad_request; an empty value is omitted.
Pattern^(0|[1-9][0-9]*)$Example50
Responses
Recent opens, closes and liquidations (ticker). Opens carry entryWad; closes and liquidations carry exitWad. priceWad is the relevant one. limit (canonical decimal, 1 to 18446744073709551615) is forwarded when present; an empty limit is omitted.
application/json
dataRecentPositionsrequiredNewest first.
entriesRecentTrade[]requiredatMsstringrequiredMilliseconds.
Pattern^-?(0|[1-9][0-9]*)n$Example1796677200000nentryWadstring | nullScaled by 1e18 (WAD).
Pattern^-?(0|[1-9][0-9]*)n$Example74250000000000000000nexitWadstring | nullScaled by 1e18 (WAD).
Pattern^-?(0|[1-9][0-9]*)n$Example74250000000000000000nisLongboolean | nullkindstringrequiredA trade activity kind.
One ofopencloseliquidateleveragestring | nullPattern^-?(0|[1-9][0-9]*)n$Example10nmarginstring | nullPattern^-?(0|[1-9][0-9]*)n$Example100000000nmarketIdstring | nullPattern^0x[0-9a-f]{64}$Example0x6e6238eb4f69bfcc3e884a7d20904eb0995ca2e42c95dc8560d5a417486ab645notionalstring | nullPattern^-?(0|[1-9][0-9]*)n$Example1000000000npositionIdstring | nullPattern^-?(0|[1-9][0-9]*)n$Example1042npriceWadstring | nullentry_wadfor an open,exit_wadotherwise.Pattern^-?(0|[1-9][0-9]*)n$Example74250000000000000000nsidenull | stringsymbolstring | nullExampleWTItxDigeststringrequiredPattern^[1-9A-HJ-NP-Za-km-z]{32,44}$Examplec3CE1sYJ2ufo1E8wNhVahkJbu66F4tMxpTXLeW3o8QSAwalletAddressstringrequiredPattern^0x[0-9a-f]{64}$Example0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d
Example request
curl 'https://api.parchment.trade/positions/recent'const res = await fetch("https://api.parchment.trade/positions/recent");
const { data } = await res.json();Example response (200)
{
"data": {
"entries": [
{
"atMs": "1796677200000n",
"entryWad": "74250000000000000000n",
"exitWad": "74250000000000000000n",
"isLong": true,
"kind": "open",
"leverage": "10n",
"margin": "100000000n",
"marketId": "0x6e6238eb4f69bfcc3e884a7d20904eb0995ca2e42c95dc8560d5a417486ab645",
"notional": "1000000000n",
"positionId": "1042n",
"priceWad": "74250000000000000000n",
"side": "long",
"symbol": "WTI",
"txDigest": "c3CE1sYJ2ufo1E8wNhVahkJbu66F4tMxpTXLeW3o8QSA",
"walletAddress": "0x77b909b550ed11c45f1378c03c0954c0d77d320cdc938e35509564b1e505ce0d"
}
]
}
}Protocol summary
/protocolResponses
application/json
dataProtocolrequiredclosesPausedbooleanrequiredGlobal close pause, as indexed.
equitystring | nullPattern^-?(0|[1-9][0-9]*)n$Example1850000000000nlpCashstring | nullPattern^-?(0|[1-9][0-9]*)n$Example1850000000000nopenNotionalstringrequiredPattern^-?(0|[1-9][0-9]*)n$Example1850000000000nopenPositionsstringrequiredPattern^-?(0|[1-9][0-9]*)n$Example24npausedboolean | nullqueueLengthstringrequiredPattern^-?(0|[1-9][0-9]*)n$Example24nvolumeNotionalstringrequiredSum of the notional of every open.
Pattern^-?(0|[1-9][0-9]*)n$Example1000000000n
Example request
curl 'https://api.parchment.trade/protocol'const res = await fetch("https://api.parchment.trade/protocol");
const { data } = await res.json();Example response (200)
{
"data": {
"closesPaused": true,
"equity": "1850000000000n",
"lpCash": "1850000000000n",
"openNotional": "1850000000000n",
"openPositions": "24n",
"paused": true,
"queueLength": "24n",
"volumeNotional": "1000000000n"
}
}