Developer reference
Read API and streams
The read API serves market state, history and accounts; a Server-Sent Events stream and public channels push changes. All schemas are generated from the code.
Conventions
- Integer amounts are canonical decimal strings (no sign, no leading zeros), so they stay exact in every language; each schema states the unit.
- Errors use one envelope:
ok: false, an error code, a message and, when rate-limited, how long to wait. - Account state comes with revisions; a client applies patches only on top of the revision they name and resubscribes on a gap.
Endpoints
GET /state/trading
Markets, limits, fees, impact parameters, pauses and caps (also on trading:current).
Response: tradingStateV2Schema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"schemaVersion": {
"type": "number",
"const": 2
},
"indexedThroughBlock": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"indexedThroughTimestamp": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"tradingPaused": {
"type": "boolean"
},
"breaker": {
"type": "object",
"properties": {
"tripped": {
"type": "boolean"
},
"trippedAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"guardianResetAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"autoResetAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"halfLifeSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"tripped",
"trippedAtMs",
"guardianResetAtMs",
"autoResetAtMs",
"halfLifeSec"
]
},
"minMarginRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"minNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"fees": {
"type": "object",
"properties": {
"winWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lossWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"liqWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"stakerShareBps": {
"default": 5000,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"referralFeeBps": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"referralDiscountBps": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"liqReferralEnabled": {
"default": false,
"type": "boolean"
}
},
"required": [
"winWad",
"lossWad",
"liqWad"
]
},
"settlement": {
"type": "object",
"properties": {
"payoutCurve": {
"type": "string",
"enum": [
"standard",
"offHours"
]
},
"closeChecksBust": {
"type": "boolean"
}
},
"required": [
"payoutCurve",
"closeChecksBust"
]
},
"limits": {
"type": "object",
"properties": {
"maxCloseIds": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxOpenPositionsPerUser": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxDebtNodes": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxLiqBatch": {
"type": "integer",
"minimum": 1,
"maximum": 65535
}
},
"required": [
"maxCloseIds",
"maxOpenPositionsPerUser",
"maxDebtNodes",
"maxLiqBatch"
]
},
"withdraw": {
"type": "object",
"properties": {
"min6": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"activationFeeWei": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"activationChargedToSender": {
"type": "boolean"
}
},
"required": [
"min6",
"activationFeeWei",
"activationChargedToSender"
]
},
"sessions": {
"type": "object",
"properties": {
"maxSessionDurationSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"maxIntentTtlSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"maxSessionDurationSec",
"maxIntentTtlSec"
]
},
"directClose": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"disabled",
"failsafe",
"always"
]
},
"failsafeDelaySec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"lastBatchAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"mode",
"failsafeDelaySec",
"lastBatchAtMs"
]
},
"staking": {
"type": "object",
"properties": {
"accRewardPerShareRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"accPrecision": {
"type": "string",
"const": "1e36"
},
"totalStakedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"accRewardPerShareRaw",
"accPrecision",
"totalStakedRaw"
]
},
"instruments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"assetIndex": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"priceScale": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"szDecimals": {
"type": "integer",
"minimum": 0,
"maximum": 6
},
"status": {
"type": "string",
"enum": [
"active",
"retired"
]
},
"retiredAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"freezeSource": {
"anyOf": [
{
"type": "string",
"enum": [
"bbo",
"mark",
"oracle"
]
},
{
"type": "null"
}
]
},
"frozenBidRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"frozenAskRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"maxLeverage": {
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"maxNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"bustBufferWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"deadbandDivisor": {
"type": "integer",
"minimum": 1,
"maximum": 4294967295
},
"impact": {
"type": "object",
"properties": {
"baseRateWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"rateMultiplierWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"positionMultiplierWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"referenceNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"baseRateWad",
"rateMultiplierWad",
"positionMultiplierWad",
"referenceNotionalRaw"
]
},
"guard": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"off",
"openOnly",
"full"
]
},
"maxSpreadBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"markBandBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"oracleBandBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"markClampBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"oracleClampBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"minProfitHoldSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"mode",
"maxSpreadBps",
"markBandBps",
"oracleBandBps",
"markClampBps",
"oracleClampBps",
"minProfitHoldSec"
]
},
"flow": {
"type": "object",
"properties": {
"maxOpenNotionalPerBlockRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"maxAccountNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapFloorRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapCeilingRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapEquityBps": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"maxOpenNotionalPerBlockRaw",
"maxAccountNotionalRaw",
"sideCapFloorRaw",
"sideCapCeilingRaw",
"sideCapEquityBps"
]
},
"oi": {
"type": "object",
"properties": {
"longRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"shortRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"longCapRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"shortCapRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"capCeilingRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"longRaw",
"shortRaw",
"longCapRaw",
"shortCapRaw",
"capCeilingRaw"
]
},
"relayer": {
"type": "object",
"properties": {
"closeHoldMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"closeHoldMs",
"maxNotionalRaw"
]
}
},
"required": [
"id",
"symbol",
"assetIndex",
"priceScale",
"szDecimals",
"status",
"retiredAtMs",
"freezeSource",
"frozenBidRaw",
"frozenAskRaw",
"maxLeverage",
"maxNotionalRaw",
"bustBufferWad",
"deadbandDivisor",
"impact",
"guard",
"flow",
"oi",
"relayer"
]
}
},
"intake": {
"type": "object",
"properties": {
"revision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"pausedActions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"openPosition",
"closePositions",
"withdrawToCore",
"registerSessionKey",
"registerSessionKeyV2",
"revokeSessionKeys",
"stake",
"unstake",
"claim",
"distribute",
"registerDeposit"
]
},
{
"type": "string",
"pattern": "^[a-z][A-Za-z0-9]{0,63}$"
}
]
}
},
"pausedOpenInstruments": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"allowlistOnly": {
"type": "boolean"
},
"minimumStakeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"termsVersion": {
"type": "string"
}
},
"required": [
"revision",
"pausedActions",
"pausedOpenInstruments",
"allowlistOnly",
"minimumStakeRaw",
"termsVersion"
]
},
"minClientBuild": {
"type": "string",
"minLength": 1
}
},
"required": [
"schemaVersion",
"indexedThroughBlock",
"indexedThroughTimestamp",
"tradingPaused",
"breaker",
"minMarginRaw",
"minNotionalRaw",
"fees",
"settlement",
"limits",
"withdraw",
"sessions",
"directClose",
"staking",
"instruments",
"intake"
]
}GET /state/user/live
Server-Sent Events stream of one wallet: snapshot, then revisioned patches.
Server-Sent Events
GET /state/house/current
LP and trader totals right now (also on house:current).
Response: houseCurrentSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"revision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"historyGeneration": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"historyRevision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sourceAsOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"head": {
"type": "array",
"prefixItems": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"items": {},
"minItems": 9
},
"extra": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
"additionalProperties": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
},
"heads": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"1000",
"60000",
"3600000",
"86400000"
]
},
"additionalProperties": {
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"lp": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"pnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"q": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bs": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"el": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"es": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"dl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"lp",
"pnl",
"q",
"bl",
"bs",
"el",
"es"
],
"additionalProperties": {}
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"source"
]
}
}
},
"required": [
"ok",
"revision",
"historyGeneration",
"historyRevision",
"sourceAsOfMs",
"head",
"heads"
]
}GET /state/house/history
Second-resolution history of the house head.
Response: houseHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"lp": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"pnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"q": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bs": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"el": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"es": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"dl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"lp",
"pnl",
"q",
"bl",
"bs",
"el",
"es"
],
"additionalProperties": {}
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"source"
]
}GET /state/house/delta
House PnL across ±1 % of the mark.
Response: houseDeltaSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"sourceAsOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"delta": {
"type": "object",
"properties": {
"coin": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"t": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"mark": {
"type": "number"
},
"range": {
"type": "number"
},
"samples": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"positionCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"values": {
"type": "array",
"items": {
"type": "number"
}
},
"min": {
"type": "number"
},
"max": {
"type": "number"
}
},
"required": [
"coin",
"t",
"mark",
"range",
"samples",
"positionCount",
"values",
"min",
"max"
]
}
},
"required": [
"ok",
"sourceAsOfMs",
"delta"
]
}GET /state/protocol/position-topology
Heat map of open positions.
Response: positionTopologySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"grid": {
"type": "object",
"properties": {
"w": {
"type": "number",
"const": 96
},
"h": {
"type": "number",
"const": 64
},
"data": {
"minItems": 6144,
"maxItems": 6144,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
"required": [
"w",
"h",
"data"
]
},
"nExt": {
"type": "number"
},
"pExt": {
"type": "number"
},
"computedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"ok",
"count",
"grid",
"nExt",
"pExt",
"computedAtMs"
]
}GET /state/leaderboard/positions
Top open positions by window.
Response: leaderboardPositionsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"rows": {
"maxItems": 15,
"type": "array",
"items": {
"type": "object",
"properties": {
"rank": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"positionId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"leaderboardName": {
"type": [
"string",
"null"
]
},
"instrument": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"instrumentPriceScale": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"instrumentTerminal": {
"type": "boolean"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"margin": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"entryPrice": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"exitPrice": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"pnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"openedAt": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"closedAt": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"rank",
"positionId",
"address",
"leaderboardName",
"instrument",
"instrumentId",
"instrumentPriceScale",
"instrumentTerminal",
"side",
"leverage",
"margin",
"entryPrice",
"exitPrice",
"pnl",
"openedAt",
"closedAt"
]
}
}
},
"required": [
"ok",
"rows"
]
}GET /state/leaderboard/accounts
Account leaderboard.
Response: leaderboardAccountsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"summary": {
"type": "object",
"properties": {
"uniqueAccounts": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"trackedBalance": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"trackedQueued": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"trackedOpenNotional": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"trackedToken": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"uniqueAccounts",
"trackedBalance",
"trackedQueued",
"trackedOpenNotional",
"trackedToken"
]
},
"accounts": {
"maxItems": 25,
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"leaderboardName": {
"type": [
"string",
"null"
]
},
"realizedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"totalWindowedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"totalVolume": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lastActiveTs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"currentBalance": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentQueued": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentOpenNotional": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentUnrealizedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"tokenTotal": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"stakingRewards": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"_leaderboardRank": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"address",
"leaderboardName",
"realizedPnl",
"totalWindowedPnl",
"totalVolume",
"lastActiveTs",
"currentBalance",
"currentQueued",
"currentOpenNotional",
"currentUnrealizedPnl",
"tokenTotal",
"stakingRewards",
"_leaderboardRank"
]
}
},
"pageInfo": {
"type": "object",
"properties": {
"page": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"totalPages": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"page",
"totalPages"
]
}
},
"required": [
"ok",
"count",
"summary",
"accounts",
"pageInfo"
]
}GET /state/leaderboard/accounts/:a
One account on the leaderboard.
Response: leaderboardSelfSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"selfIndex": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"selfRow": {
"anyOf": [
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"leaderboardName": {
"type": [
"string",
"null"
]
},
"realizedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"totalWindowedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"totalVolume": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lastActiveTs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"currentBalance": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentQueued": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentOpenNotional": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"currentUnrealizedPnl": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"tokenTotal": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"stakingRewards": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"_leaderboardRank": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"address",
"leaderboardName",
"realizedPnl",
"totalWindowedPnl",
"totalVolume",
"lastActiveTs",
"currentBalance",
"currentQueued",
"currentOpenNotional",
"currentUnrealizedPnl",
"tokenTotal",
"stakingRewards",
"_leaderboardRank"
]
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"selfIndex",
"selfRow"
]
}GET /query/protocol/summary
Protocol totals (also on protocol:summary).
Response: protocolSummarySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"stale": {
"type": "boolean"
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"genesis": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at",
"genesis"
]
},
"balances": {
"type": "object",
"properties": {
"tvl": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"margin": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lp": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"reserve": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"queue": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"tvl",
"margin",
"lp",
"reserve",
"queue"
]
},
"activity": {
"type": "object",
"properties": {
"volume": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"open": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"volume",
"open"
]
},
"fees": {
"type": "object",
"properties": {
"pending": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lifetime": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"pending",
"lifetime"
]
},
"token": {
"type": "object",
"properties": {
"supply": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"staked": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"trackedLp": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"accumulator": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"tailProgress": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"reserve": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"unallocated": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"pendingRewards": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"cliff": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"cap": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"excess": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"rate": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"decay": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"supply",
"staked",
"trackedLp",
"accumulator",
"tailProgress",
"reserve",
"unallocated",
"pendingRewards",
"cliff",
"cap",
"excess",
"rate",
"decay"
]
}
},
"required": [
"ok",
"source",
"balances",
"activity",
"fees",
"token"
]
}GET /query/protocol/queue-summary
The payout queue: total, length, head.
Response: queueSummarySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"stale": {
"type": "boolean"
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at"
]
},
"total": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"largest": {
"anyOf": [
{
"type": "object",
"properties": {
"nodeId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"user": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"amount": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"nodeId",
"user",
"amount"
]
},
{
"type": "null"
}
]
},
"front": {
"anyOf": [
{
"type": "object",
"properties": {
"nodeId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"user": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"amount": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"nodeId",
"user",
"amount"
]
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"source",
"total",
"count",
"largest",
"front"
]
}GET /query/protocol/history
Protocol history by interval.
Response: protocolHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"startMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"revision": {
"type": "string"
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
},
"columns": {
"type": "object",
"properties": {
"tvl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"stakingRewards": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"volume": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"volumeBtc": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"volumeEth": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"traderPnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"users": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"liquidation": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"trades": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"tokenSupply": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"tokenStaked": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"stakerRevenue": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"tvl",
"stakingRewards",
"volume",
"volumeBtc",
"volumeEth",
"traderPnl",
"users",
"liquidation",
"trades",
"tokenSupply",
"tokenStaked",
"stakerRevenue"
]
},
"totals": {
"type": "object",
"properties": {
"tvlRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"rewardsRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"volumeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"liquidationRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"tradesRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"usersRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"stakerFees24hRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"tvlRaw",
"rewardsRaw",
"volumeRaw",
"liquidationRaw",
"tradesRaw",
"usersRaw",
"stakerFees24hRaw"
]
}
},
"required": [
"startMs",
"intervalMs",
"source",
"columns",
"totals"
]
}GET /query/protocol/token/activity
Token minting and staking activity.
Response: tokenActivitySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"maxItems": 25,
"type": "array",
"items": {
"type": "object",
"properties": {
"blockNumber": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"logIndex": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"amountRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"minted",
"staked",
"unstaked"
]
},
"userAddress": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
}
},
"required": [
"blockNumber",
"logIndex",
"timestampMs",
"txHash",
"amountRaw",
"kind",
"userAddress"
]
}
},
"latestDistribution": {
"anyOf": [
{
"type": "object",
"properties": {
"blockNumber": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"newRewardsRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"allocatedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"unallocatedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"accRewardPerShareRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"totalStakedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"blockNumber",
"timestampMs",
"txHash",
"newRewardsRaw",
"allocatedRaw",
"unallocatedRaw",
"accRewardPerShareRaw",
"totalStakedRaw"
]
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"latestDistribution"
]
}GET /query/protocol/trades/recent
The most recent trades.
Response: recentTradesSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"events": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"seq": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"ts": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wallet": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"instrument": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"instrumentTerminal": {
"type": "boolean"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"notionalUsd": {
"type": "number"
},
"positionId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"open",
"close",
"liq"
]
},
"entry": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"exit": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"pnlUsd": {
"type": [
"number",
"null"
]
},
"intentId": {
"anyOf": [
{
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
{
"type": "null"
}
]
}
},
"required": [
"seq",
"ts",
"wallet",
"instrument",
"instrumentId",
"instrumentTerminal",
"side",
"leverage",
"notionalUsd",
"positionId",
"kind",
"entry",
"exit",
"pnlUsd",
"intentId"
]
}
}
},
"required": [
"ok",
"count",
"events"
]
}GET /query/protocol/market-stats
24-hour volume per instrument.
Response: marketStatsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"markets": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
"additionalProperties": {
"type": "object",
"properties": {
"volume_24h": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"volume_24h"
]
}
}
},
"required": [
"ok",
"markets"
]
}GET /query/markets/:id/price-history
Recorded execution prices of an instrument.
Response: priceHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"price": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"price"
],
"additionalProperties": {}
},
"series": {
"type": "string",
"pattern": "^market:(0|[1-9][0-9]*)$"
},
"aggregation": {
"type": "string",
"const": "last"
},
"fromMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"toMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"coverage": {
"type": "object",
"properties": {
"complete": {
"type": "boolean"
},
"availableFromMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"availableToMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"complete",
"availableFromMs",
"availableToMs"
]
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"revision": {
"type": "string"
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"series",
"aggregation",
"fromMs",
"toMs",
"coverage",
"source"
]
}GET /query/markets/:id/liquidation-map
Open interest by bust price.
Response: liquidationMapSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"range": {
"type": "string",
"enum": [
"1",
"2",
"5",
"10",
"25",
"0.1",
"0.25",
"0.5"
]
},
"fromRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"toRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"priceScale": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"priceAt": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at",
"priceAt"
]
},
"buckets": {
"minItems": 150,
"maxItems": 150,
"type": "array",
"items": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
],
"items": false,
"minItems": 4,
"maxItems": 4
}
},
"below": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
],
"items": false,
"minItems": 4,
"maxItems": 4
},
"above": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
],
"items": false,
"minItems": 4,
"maxItems": 4
}
},
"required": [
"ok",
"instrumentId",
"range",
"fromRaw",
"toRaw",
"priceScale",
"source",
"buckets",
"below",
"above"
]
}GET /query/house/history
House history by interval.
Response: houseHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"lp": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"pnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"q": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bs": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"el": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"es": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"dl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"lp",
"pnl",
"q",
"bl",
"bs",
"el",
"es"
],
"additionalProperties": {}
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"source"
]
}GET /query/house/staker-payouts
Cumulative payouts to stakers.
Response: stakerPayoutsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"baseUsd": {
"type": "number"
},
"points": {
"type": "array",
"items": {
"type": "array",
"prefixItems": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "number"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
}
},
"required": [
"intervalMs",
"baseUsd",
"points"
]
}GET /query/accounts/:a/trades
An account's trades (paged).
Request: pageQuerySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cursor": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
"limit": {
"type": "string",
"pattern": "^[1-9][0-9]{0,2}$"
}
}
}Response: accountTradesSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"positionId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"assetIndex": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"priceScale": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"terminal": {
"type": "boolean"
},
"retired": {
"type": "boolean"
},
"isLong": {
"type": "boolean"
},
"entryPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"marginRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"kind": {
"type": "string",
"enum": [
"PositionClosed",
"Liquidated"
]
},
"openedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"exitPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"adjustedPnlRaw": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"userPaidFeeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"mintedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"mintBasisRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"mintBatchTotalRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
}
},
"required": [
"timestampMs",
"txHash",
"positionId",
"instrumentId",
"symbol",
"assetIndex",
"priceScale",
"terminal",
"retired",
"isLong",
"entryPriceRaw",
"marginRaw",
"leverage",
"kind",
"openedAtMs",
"exitPriceRaw",
"adjustedPnlRaw",
"userPaidFeeRaw",
"mintedRaw",
"mintBasisRaw",
"mintBatchTotalRaw"
]
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
]
}GET /query/accounts/:a/cashflows
An account's deposits, withdrawals and payouts (paged).
Request: pageQuerySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cursor": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
"limit": {
"type": "string",
"pattern": "^[1-9][0-9]{0,2}$"
}
}
}Response: accountCashflowsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"amountRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"Deposit",
"Withdrawal"
]
},
"recipientAmountRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"route": {
"anyOf": [
{
"anyOf": [
{
"type": "string",
"enum": [
"hypercore",
"hyperevm",
"ethereum",
"arbitrum",
"solana"
]
},
{
"type": "string",
"pattern": "^[a-z][A-Za-z0-9]{0,63}$"
}
]
},
{
"type": "null"
}
]
},
"withdrawalStatus": {
"anyOf": [
{
"type": "string",
"enum": [
"signed",
"submitted",
"in_transit",
"settled",
"needs_signature",
"failed"
]
},
{
"type": "null"
}
]
}
},
"required": [
"timestampMs",
"txHash",
"amountRaw",
"kind",
"recipientAmountRaw",
"route",
"withdrawalStatus"
]
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
]
}GET /query/accounts/:a/staking
An account's staking history (paged).
Request: pageQuerySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cursor": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
"limit": {
"type": "string",
"pattern": "^[1-9][0-9]{0,2}$"
}
}
}Response: accountStakingSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"amountRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"staked",
"unstaked",
"claimed"
]
}
},
"required": [
"timestampMs",
"txHash",
"amountRaw",
"kind"
]
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
]
}GET /query/accounts/:a/queue
An account's payout-queue history (paged).
Request: pageQuerySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cursor": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
"limit": {
"type": "string",
"pattern": "^[1-9][0-9]{0,2}$"
}
}
}Response: accountQueueHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"amountRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"enqueued",
"harvested",
"debt_consumed"
]
},
"eventCount": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"timestampMs",
"txHash",
"amountRaw",
"kind",
"eventCount"
]
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
]
}GET /query/accounts/:a/queue-ring
An account's own queued claims as [nodeId, amount, ahead, position], positions counted from 1.
Response: queueRingSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at"
]
},
"total": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "object",
"properties": {
"total": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"total",
"count"
]
},
"truncated": {
"type": "boolean"
},
"entries": {
"maxItems": 500,
"type": "array",
"items": {
"type": "array",
"prefixItems": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
],
"items": false,
"minItems": 4,
"maxItems": 4
}
}
},
"required": [
"ok",
"source",
"total",
"count",
"account",
"truncated",
"entries"
]
}GET /query/accounts/:a/queue-balances
An account's queue balances (positions counted from 1, as in queue-ring).
Response: queueBalancesSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at"
]
},
"total": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "object",
"properties": {
"total": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"total",
"count"
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"nodeId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"amount": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"enqueuedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"enqueuedTxHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"position": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"amountAhead": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"nodeId",
"amount",
"enqueuedAtMs",
"enqueuedTxHash",
"position",
"amountAhead"
]
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,512}$"
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"source",
"total",
"count",
"account",
"items",
"nextCursor"
]
}GET /query/accounts/:a/portfolio-history
Equity and PnL history.
Response: portfolioHistorySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"equity": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"pnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"stakingRewards": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"equity",
"pnl"
],
"additionalProperties": {}
},
"series": {
"type": "string",
"const": "portfolio"
},
"aggregation": {
"type": "string",
"const": "samples"
},
"fromMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"toMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"coverage": {
"type": "object",
"properties": {
"complete": {
"type": "boolean"
},
"availableFromMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"availableToMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"complete",
"availableFromMs",
"availableToMs"
]
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"revision": {
"type": "string"
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"series",
"aggregation",
"fromMs",
"toMs",
"coverage",
"source"
]
}GET /query/accounts/:a/funding
Deposits and withdrawals in flight, with their status.
Response: accountFundingSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"route": {
"anyOf": [
{
"type": "string",
"enum": [
"hypercore",
"hyperevm",
"ethereum",
"arbitrum",
"solana"
]
},
{
"type": "string",
"pattern": "^[a-z][A-Za-z0-9]{0,63}$"
}
]
},
"destination": {
"type": [
"string",
"null"
]
},
"amount": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"status": {
"type": "string",
"enum": [
"signed",
"submitted",
"in_transit",
"settled",
"needs_signature",
"failed"
]
},
"createdAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"exchangeTxHash": {
"anyOf": [
{
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
{
"type": "null"
}
]
},
"burnTxHash": {
"type": [
"string",
"null"
]
},
"onward": {
"anyOf": [
{
"type": "object",
"properties": {
"nonce": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"maximumFee": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"createRecipient": {
"type": "boolean"
},
"detail": {
"anyOf": [
{
"type": "string",
"maxLength": 512,
"pattern": "^[a-z][A-Za-z0-9]{0,63}(?::[\\s\\S]*)?$"
},
{
"type": "null"
}
]
}
},
"required": [
"nonce",
"maximumFee",
"createRecipient",
"detail"
]
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"route",
"destination",
"amount",
"status",
"createdAtMs",
"exchangeTxHash",
"burnTxHash",
"onward"
]
}
},
"coreAccount": {
"type": "boolean"
}
},
"required": [
"items",
"coreAccount"
]
}GET /query/accounts/:a/leaderboard-badges
An account's leaderboard badges.
Response: leaderboardBadgesSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"badges": {
"type": "object",
"properties": {
"daily": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top3": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top15": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"first",
"top3",
"top15"
]
},
"weekly": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top3": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top15": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"first",
"top3",
"top15"
]
},
"monthly": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top3": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top15": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"first",
"top3",
"top15"
]
},
"allTime": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top3": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"top15": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"first",
"top3",
"top15"
]
}
},
"required": [
"daily",
"weekly",
"monthly",
"allTime"
]
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"badges",
"total"
]
}GET /query/accounts/:a/positions
Positions by id.
Response: accountPositionsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"open": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"owner": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"isLong": {
"type": "boolean"
},
"useDebt": {
"type": "boolean"
},
"entryPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"marginRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"bustPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"openedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"closedAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"exitPriceRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"netPnlRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"liquidated": {
"type": "boolean"
}
},
"required": [
"id",
"owner",
"instrumentId",
"isLong",
"useDebt",
"entryPriceRaw",
"marginRaw",
"leverage",
"bustPriceRaw",
"openedAtMs",
"closedAtMs",
"exitPriceRaw",
"netPnlRaw",
"liquidated"
]
}
},
"closed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"owner": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"isLong": {
"type": "boolean"
},
"useDebt": {
"type": "boolean"
},
"entryPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"marginRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"bustPriceRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"openedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"closedAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"exitPriceRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"netPnlRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"liquidated": {
"type": "boolean"
}
},
"required": [
"id",
"owner",
"instrumentId",
"isLong",
"useDebt",
"entryPriceRaw",
"marginRaw",
"leverage",
"bustPriceRaw",
"openedAtMs",
"closedAtMs",
"exitPriceRaw",
"netPnlRaw",
"liquidated"
]
}
}
},
"required": [
"open",
"closed"
]
}GET /query/notices
Operator notices (plain text).
Response: noticesSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"notices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"tone": {
"type": "string",
"enum": [
"info",
"warning",
"critical"
]
},
"placements": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"enum": [
"toast",
"tape"
]
}
},
"title": {
"type": "string"
},
"body": {
"type": [
"string",
"null"
]
},
"eventAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"expiresAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"id",
"tone",
"placements",
"title",
"body",
"eventAtMs",
"expiresAtMs"
]
}
}
},
"required": [
"notices"
]
}GET /query/leaderboard/name/:a
An account's public display name.
Response: leaderboardNameSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"leaderboardName": {
"type": [
"string",
"null"
]
}
},
"required": [
"ok",
"address",
"leaderboardName"
]
}POST /query/leaderboard/name
Set or clear the display name (personal_sign).
Request: leaderboardNameRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"action": {
"type": "string",
"const": "set"
},
"name": {
"type": "string"
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"action",
"name",
"signedAtMs",
"signature"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"action": {
"type": "string",
"const": "clear"
},
"name": {
"type": "string",
"const": ""
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"action",
"name",
"signedAtMs",
"signature"
],
"additionalProperties": false
}
]
}Response: leaderboardNameResponseSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"leaderboardName": {
"type": [
"string",
"null"
]
},
"changed": {
"type": "boolean"
},
"nextNameChangeAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"address",
"leaderboardName",
"changed",
"nextNameChangeAtMs"
]
}GET /query/avatars
Saved profile-picture seeds of 1–50 addresses (`addresses=a,b,…`: lowercase, ascending, distinct). An address without a saved seed is absent; clients then draw the seed its address folds to.
Response: avatarsSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"avatars": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"additionalProperties": {
"type": "string",
"pattern": "^[0-9a-f]{8}$"
}
}
},
"required": [
"ok",
"avatars"
]
}POST /query/avatars
Save the profile-picture seed (personal_sign). Needs a deposit (403 avatar_activity_required); 10 per minute per IP and 5 per hour per address (429).
Request: avatarRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"seed": {
"type": "string",
"pattern": "^[0-9a-f]{8}$"
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"seed",
"signedAtMs",
"signature"
],
"additionalProperties": false
}Response: avatarResponseSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"seed": {
"type": "string",
"pattern": "^[0-9a-f]{8}$"
},
"changed": {
"type": "boolean"
}
},
"required": [
"ok",
"address",
"seed",
"changed"
]
}GET /query/referrals/code/:a
An account's referral code (none while it has not chosen one).
Response: referralCodeSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"code": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"address",
"code"
]
}GET /query/referrals/resolve/:code
The address behind a referral code (404 not_found when no account holds it).
Response: referralCodeResolveSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"code": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
}
},
"required": [
"ok",
"code",
"address"
]
}POST /query/referrals/code
Set or clear the referral code (personal_sign). Needs a deposit (403 referral_code_activity_required); one change a day (429 referral_code_cooldown); 10 per minute per IP and 5 per hour per address (429).
Request: referralCodeRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"action": {
"type": "string",
"const": "set"
},
"code": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"action",
"code",
"signedAtMs",
"signature"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"action": {
"type": "string",
"const": "clear"
},
"code": {
"type": "string",
"const": ""
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"action",
"code",
"signedAtMs",
"signature"
],
"additionalProperties": false
}
]
}Response: referralCodeResponseSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"code": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
{
"type": "null"
}
]
},
"changed": {
"type": "boolean"
},
"nextCodeChangeAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"ok",
"address",
"code",
"changed",
"nextCodeChangeAtMs"
]
}GET /query/referrals/:a
An account's referral page: its code, who referred it, its totals as a referrer and its newest referral-fee distributions.
Response: referralSummarySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"code": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
{
"type": "null"
}
]
},
"referrer": {
"anyOf": [
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"code": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{3,20}$"
},
{
"type": "null"
}
]
},
"boundBlock": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"address",
"code",
"boundBlock"
]
},
{
"type": "null"
}
]
},
"savedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"referees": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"extraRewardBps": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"earnedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"extraRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"feeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"recent": {
"type": "array",
"items": {
"type": "object",
"properties": {
"blockNumber": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"kind": {
"type": "string",
"enum": [
"close",
"liquidation"
]
},
"user": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"feeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"toReferrerRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"discountRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"extraRewardRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"txHash": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
}
},
"required": [
"blockNumber",
"kind",
"user",
"feeRaw",
"toReferrerRaw",
"discountRaw",
"extraRewardRaw",
"txHash"
]
}
}
},
"required": [
"ok",
"address",
"code",
"referrer",
"savedRaw",
"referees",
"extraRewardBps",
"earnedRaw",
"extraRaw",
"feeRaw",
"recent"
]
}GET /terms/status
Which Terms version an address accepted; `published` is false while no Terms are in force (version '0').
Response: termsStatusSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"currentVersion": {
"type": "string",
"minLength": 1
},
"published": {
"type": "boolean"
},
"acceptedVersion": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"acceptedAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"currentVersion",
"published",
"acceptedVersion",
"acceptedAtMs"
]
}POST /terms/accept
Record acceptance of the Terms (personal_sign). 400 while no Terms are published; 10 per minute per IP (429).
Request: termsAcceptRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"version": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"signedAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"signature": {
"type": "string",
"pattern": "^0x[0-9a-f]{130}$"
}
},
"required": [
"address",
"version",
"signedAtMs",
"signature"
],
"additionalProperties": false
}POST /funding/deposits/check
Look up the user's deposit proxy (compare it with the locally computed address). 403 terms_required until the wallet accepts the published Terms.
Request: depositCheckRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"user": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
}
},
"required": [
"user"
],
"additionalProperties": false
}Response: depositCheckResponseSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"proxy": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
}
},
"required": [
"proxy"
]
}POST /funding/deposits/track
Register a deposit for the support timeline (routes hyperevm, ethereum, arbitrum, solana, robinhood; at most 20 in progress per user, 429 beyond).
Request: depositTrackRequestSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"user": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"route": {
"type": "string",
"enum": [
"hyperevm",
"ethereum",
"arbitrum",
"solana",
"robinhood"
]
},
"sourceTxHash": {
"anyOf": [
{
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
{
"type": "string",
"pattern": "^[1-9A-HJ-NP-Za-km-z]{64,88}$"
}
]
}
},
"required": [
"user",
"route",
"sourceTxHash"
],
"additionalProperties": false
}Response: depositTrackResponseSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
}
},
"required": [
"id"
]
}Error codes
| Code | HTTP status |
|---|---|
invalid_query | 400 |
invalid_request | 400 |
avatar_activity_required | 403 |
name_activity_required | 403 |
referral_code_activity_required | 403 |
terms_required | 403 |
not_found | 404 |
intake_action_paused | 422 |
name_change_cooldown | 429 |
rate_limited | 429 |
referral_code_cooldown | 429 |
region_restricted | 451 |
request_failed | 500 |
unavailable | 503 |
The account stream
GET /state/user/live is a Server-Sent Events stream for one wallet. It starts with a liveness event announcing the heartbeat interval, then a wallet snapshot, then wallet patches; heartbeat events keep the connection alive.
| Event | Payload |
|---|---|
liveness |
|
wallet |
|
heartbeat | none |
Public channels
Market-wide updates are published on these channels:
trading:current
The /state/trading frame, when it changes (at most once per block).
tradingStateV2Schema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"schemaVersion": {
"type": "number",
"const": 2
},
"indexedThroughBlock": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"indexedThroughTimestamp": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"tradingPaused": {
"type": "boolean"
},
"breaker": {
"type": "object",
"properties": {
"tripped": {
"type": "boolean"
},
"trippedAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"guardianResetAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"autoResetAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"halfLifeSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"tripped",
"trippedAtMs",
"guardianResetAtMs",
"autoResetAtMs",
"halfLifeSec"
]
},
"minMarginRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"minNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"fees": {
"type": "object",
"properties": {
"winWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lossWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"liqWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"stakerShareBps": {
"default": 5000,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"referralFeeBps": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"referralDiscountBps": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"liqReferralEnabled": {
"default": false,
"type": "boolean"
}
},
"required": [
"winWad",
"lossWad",
"liqWad"
]
},
"settlement": {
"type": "object",
"properties": {
"payoutCurve": {
"type": "string",
"enum": [
"standard",
"offHours"
]
},
"closeChecksBust": {
"type": "boolean"
}
},
"required": [
"payoutCurve",
"closeChecksBust"
]
},
"limits": {
"type": "object",
"properties": {
"maxCloseIds": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxOpenPositionsPerUser": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxDebtNodes": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"maxLiqBatch": {
"type": "integer",
"minimum": 1,
"maximum": 65535
}
},
"required": [
"maxCloseIds",
"maxOpenPositionsPerUser",
"maxDebtNodes",
"maxLiqBatch"
]
},
"withdraw": {
"type": "object",
"properties": {
"min6": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"activationFeeWei": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"activationChargedToSender": {
"type": "boolean"
}
},
"required": [
"min6",
"activationFeeWei",
"activationChargedToSender"
]
},
"sessions": {
"type": "object",
"properties": {
"maxSessionDurationSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"maxIntentTtlSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"maxSessionDurationSec",
"maxIntentTtlSec"
]
},
"directClose": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"disabled",
"failsafe",
"always"
]
},
"failsafeDelaySec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"lastBatchAtMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"mode",
"failsafeDelaySec",
"lastBatchAtMs"
]
},
"staking": {
"type": "object",
"properties": {
"accRewardPerShareRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"accPrecision": {
"type": "string",
"const": "1e36"
},
"totalStakedRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"accRewardPerShareRaw",
"accPrecision",
"totalStakedRaw"
]
},
"instruments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"assetIndex": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"priceScale": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"szDecimals": {
"type": "integer",
"minimum": 0,
"maximum": 6
},
"status": {
"type": "string",
"enum": [
"active",
"retired"
]
},
"retiredAtMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"freezeSource": {
"anyOf": [
{
"type": "string",
"enum": [
"bbo",
"mark",
"oracle"
]
},
{
"type": "null"
}
]
},
"frozenBidRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"frozenAskRaw": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"maxLeverage": {
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"maxNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"bustBufferWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"deadbandDivisor": {
"type": "integer",
"minimum": 1,
"maximum": 4294967295
},
"impact": {
"type": "object",
"properties": {
"baseRateWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"rateMultiplierWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"positionMultiplierWad": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"referenceNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"baseRateWad",
"rateMultiplierWad",
"positionMultiplierWad",
"referenceNotionalRaw"
]
},
"guard": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"off",
"openOnly",
"full"
]
},
"maxSpreadBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"markBandBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"oracleBandBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"markClampBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"oracleClampBps": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"minProfitHoldSec": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"mode",
"maxSpreadBps",
"markBandBps",
"oracleBandBps",
"markClampBps",
"oracleClampBps",
"minProfitHoldSec"
]
},
"flow": {
"type": "object",
"properties": {
"maxOpenNotionalPerBlockRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"maxAccountNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapFloorRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapCeilingRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sideCapEquityBps": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"required": [
"maxOpenNotionalPerBlockRaw",
"maxAccountNotionalRaw",
"sideCapFloorRaw",
"sideCapCeilingRaw",
"sideCapEquityBps"
]
},
"oi": {
"type": "object",
"properties": {
"longRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"shortRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"longCapRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"shortCapRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"capCeilingRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"longRaw",
"shortRaw",
"longCapRaw",
"shortCapRaw",
"capCeilingRaw"
]
},
"relayer": {
"type": "object",
"properties": {
"closeHoldMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxNotionalRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"closeHoldMs",
"maxNotionalRaw"
]
}
},
"required": [
"id",
"symbol",
"assetIndex",
"priceScale",
"szDecimals",
"status",
"retiredAtMs",
"freezeSource",
"frozenBidRaw",
"frozenAskRaw",
"maxLeverage",
"maxNotionalRaw",
"bustBufferWad",
"deadbandDivisor",
"impact",
"guard",
"flow",
"oi",
"relayer"
]
}
},
"intake": {
"type": "object",
"properties": {
"revision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"pausedActions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"openPosition",
"closePositions",
"withdrawToCore",
"registerSessionKey",
"registerSessionKeyV2",
"revokeSessionKeys",
"stake",
"unstake",
"claim",
"distribute",
"registerDeposit"
]
},
{
"type": "string",
"pattern": "^[a-z][A-Za-z0-9]{0,63}$"
}
]
}
},
"pausedOpenInstruments": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
},
"allowlistOnly": {
"type": "boolean"
},
"minimumStakeRaw": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"termsVersion": {
"type": "string"
}
},
"required": [
"revision",
"pausedActions",
"pausedOpenInstruments",
"allowlistOnly",
"minimumStakeRaw",
"termsVersion"
]
},
"minClientBuild": {
"type": "string",
"minLength": 1
}
},
"required": [
"schemaVersion",
"indexedThroughBlock",
"indexedThroughTimestamp",
"tradingPaused",
"breaker",
"minMarginRaw",
"minNotionalRaw",
"fees",
"settlement",
"limits",
"withdraw",
"sessions",
"directClose",
"staking",
"instruments",
"intake"
]
}public:trades
Public trades of each block.
publicTradesPayloadSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"seq": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"ts": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wallet": {
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
},
"instrument": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"instrumentId": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"instrumentTerminal": {
"type": "boolean"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
},
"leverage": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"notionalUsd": {
"type": "number"
},
"positionId": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"kind": {
"type": "string",
"enum": [
"open",
"close",
"liq"
]
},
"entry": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"exit": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"pnlUsd": {
"type": [
"number",
"null"
]
}
},
"required": [
"seq",
"ts",
"wallet",
"instrument",
"instrumentId",
"instrumentTerminal",
"side",
"leverage",
"notionalUsd",
"positionId",
"kind",
"entry",
"exit",
"pnlUsd"
]
}
}pressure:current
Relayer queue pressure (published as JSON text, with recovery and delta compression).
pressurePayloadSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"tickRevision": {
"type": "string",
"pattern": "^[0-9a-f-]{36}:(?:0|[1-9][0-9]*)$"
},
"snapshot": {
"type": "object",
"properties": {
"schemaVersion": {
"type": "number",
"const": 1
},
"ok": {
"type": "boolean"
},
"stale": {
"type": "boolean"
},
"ts": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"source": {
"type": "string"
},
"blockGasLimit": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"totalQueuedGas": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"totalSubmittedGas": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"totalPendingGas": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"saturationPct": {
"type": "number"
},
"pendingCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"activeIntents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"submittedIntents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"queuedIntents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"chain": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"stale": {
"type": "boolean"
},
"source": {
"type": "string"
},
"latestBlockNumber": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"latestBlockTimestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"latestBlockGasUsed": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"latestBlockGasLimit": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"latestBlockUsagePct": {
"type": "number"
},
"blocks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"timestampMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"gasUsed": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"gasLimit": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"usagePct": {
"type": "number"
},
"protocolGasUsed": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"baseFeePerGas": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"transactionCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"kind": {
"type": "string",
"enum": [
"ordinary",
"big"
]
}
},
"required": [
"number",
"timestampMs",
"gasUsed",
"gasLimit",
"usagePct",
"protocolGasUsed",
"baseFeePerGas",
"transactionCount",
"kind"
]
}
}
},
"required": [
"ok",
"stale",
"source",
"latestBlockNumber",
"latestBlockTimestampMs",
"latestBlockGasUsed",
"latestBlockGasLimit",
"latestBlockUsagePct",
"blocks"
]
}
},
"required": [
"schemaVersion",
"ok",
"stale",
"ts",
"source",
"blockGasLimit",
"totalQueuedGas",
"totalSubmittedGas",
"totalPendingGas",
"saturationPct",
"pendingCount",
"activeIntents",
"submittedIntents",
"queuedIntents",
"chain"
]
}
},
"required": [
"tickRevision",
"snapshot"
]
}protocol:summary
The protocol summary, when it changes.
protocolSummarySchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"stale": {
"type": "boolean"
},
"source": {
"type": "object",
"properties": {
"block": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"at": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"genesis": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"block",
"at",
"genesis"
]
},
"balances": {
"type": "object",
"properties": {
"tvl": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"margin": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lp": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"reserve": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"queue": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"tvl",
"margin",
"lp",
"reserve",
"queue"
]
},
"activity": {
"type": "object",
"properties": {
"volume": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"open": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"volume",
"open"
]
},
"fees": {
"type": "object",
"properties": {
"pending": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"lifetime": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"pending",
"lifetime"
]
},
"token": {
"type": "object",
"properties": {
"supply": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"staked": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"trackedLp": {
"type": "string",
"pattern": "^(?:0|-?[1-9][0-9]*)$"
},
"accumulator": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"tailProgress": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"reserve": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"unallocated": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"pendingRewards": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"cliff": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"cap": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"excess": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"rate": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"decay": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
}
},
"required": [
"supply",
"staked",
"trackedLp",
"accumulator",
"tailProgress",
"reserve",
"unallocated",
"pendingRewards",
"cliff",
"cap",
"excess",
"rate",
"decay"
]
}
},
"required": [
"ok",
"source",
"balances",
"activity",
"fees",
"token"
]
}house:current
The house head, when it changes.
houseCurrentSchema · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"revision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"historyGeneration": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"historyRevision": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]*)$"
},
"sourceAsOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"head": {
"type": "array",
"prefixItems": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"items": {},
"minItems": 9
},
"extra": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
"additionalProperties": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
},
"heads": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"1000",
"60000",
"3600000",
"86400000"
]
},
"additionalProperties": {
"type": "object",
"properties": {
"baseTimeMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"timeOffsetsMs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"gapIndices": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"intervalMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"columns": {
"type": "object",
"properties": {
"lp": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"pnl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"q": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"bs": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"el": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"es": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"dl": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"required": [
"lp",
"pnl",
"q",
"bl",
"bs",
"el",
"es"
],
"additionalProperties": {}
},
"source": {
"type": "object",
"properties": {
"asOfMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"generation": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"asOfMs"
]
}
},
"required": [
"baseTimeMs",
"timeOffsetsMs",
"gapIndices",
"intervalMs",
"columns",
"source"
]
}
}
},
"required": [
"ok",
"revision",
"historyGeneration",
"historyRevision",
"sourceAsOfMs",
"head",
"heads"
]
}