Referência para desenvolvedores
API de leitura e streams
A API de leitura serve o estado dos mercados, o histórico e as contas; um stream de Server-Sent Events e canais públicos enviam as mudanças. Todos os esquemas são gerados a partir do código.
Convenções
- Valores inteiros são strings decimais canônicas (sem sinal, sem zeros à esquerda), para continuarem exatos em qualquer linguagem; cada esquema informa a unidade.
- Os erros usam um único envelope:
ok: false, um código de erro, uma mensagem e, quando há limite de requisições, quanto tempo esperar. - O estado da conta vem com revisões; um cliente só aplica um patch sobre a revisão que ele indica e se inscreve de novo quando falta alguma.
Endpoints
GET /state/trading
Mercados, limites, taxas, parâmetros de impacto, pausas e tetos (também em trading:current).
Resposta: 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
Stream de Server-Sent Events de uma carteira: um retrato e depois patches com revisão.
Server-Sent Events
GET /state/house/current
Os totais do LP e dos traders agora (também em house:current).
Resposta: 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
Histórico por segundo do resumo da casa.
Resposta: 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
PnL da casa em ±1 % em torno do preço de marcação.
Resposta: 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
Mapa de calor das posições abertas.
Resposta: 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
As melhores posições abertas por período.
Resposta: 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
Ranking de contas.
Resposta: 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
Uma conta do ranking.
Resposta: 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
Totais do protocolo (também em protocol:summary).
Resposta: 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
A fila de pagamentos: total, tamanho e início.
Resposta: 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
Histórico do protocolo por intervalo.
Resposta: 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
Atividade de cunhagem e staking do token.
Resposta: 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
As operações mais recentes.
Resposta: 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
Volume de 24 horas por instrumento.
Resposta: 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
Preços de execução registrados de um instrumento.
Resposta: 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
Contratos em aberto por preço de falência.
Resposta: 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
Histórico da casa por intervalo.
Resposta: 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
Pagamentos acumulados aos stakers.
Resposta: 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
As operações de uma conta (paginadas).
Requisição: 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}$"
}
}
}Resposta: 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
Os depósitos, saques e pagamentos de uma conta (paginados).
Requisição: 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}$"
}
}
}Resposta: 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
O histórico de staking de uma conta (paginado).
Requisição: 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}$"
}
}
}Resposta: 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
O histórico de uma conta na fila de pagamentos (paginado).
Requisição: 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}$"
}
}
}Resposta: 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
Os créditos na fila da própria conta como [nodeId, amount, ahead, position], com os lugares contados a partir de 1.
Resposta: 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
Os saldos na fila de uma conta (lugares contados a partir de 1, como em queue-ring).
Resposta: 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
Histórico de patrimônio e PnL.
Resposta: 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
Depósitos e saques em andamento, com o status de cada um.
Resposta: 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
Os selos de ranking de uma conta.
Resposta: 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
Posições por id.
Resposta: 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
Avisos do operador (texto puro).
Resposta: 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
O nome público de uma conta.
Resposta: 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
Define ou remove o nome público (personal_sign).
Requisição: 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
}
]
}Resposta: 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
Sementes de foto de perfil salvas de 1 a 50 endereços (`addresses=a,b,…`: minúsculos, em ordem crescente, sem repetição). Um endereço sem semente salva fica de fora; os clientes desenham então a semente derivada do endereço.
Resposta: 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
Salva a semente da foto de perfil (personal_sign). Exige um depósito (403 avatar_activity_required); 10 por minuto por IP e 5 por hora por endereço (429).
Requisição: 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
}Resposta: 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
O código de indicação de uma conta (nenhum enquanto ela não escolher um).
Resposta: 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
O endereço por trás de um código de indicação (404 not_found quando nenhuma conta o tem).
Resposta: 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
Define ou remove o código de indicação (personal_sign). Exige um depósito (403 referral_code_activity_required); uma troca por dia (429 referral_code_cooldown); 10 por minuto por IP e 5 por hora por endereço (429).
Requisição: 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
}
]
}Resposta: 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
A página de indicações de uma conta: o código, quem a indicou, os totais dela como indicadora e as distribuições mais recentes da taxa de indicação.
Resposta: 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
Qual versão dos Termos um endereço aceitou; `published` é false enquanto não há Termos em vigor (versão '0').
Resposta: 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
Registra o aceite dos Termos (personal_sign). 400 enquanto não há Termos publicados; 10 por minuto por IP (429).
Requisição: 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
Consulta o proxy de depósito do usuário (compare com o endereço calculado localmente). 403 terms_required até a carteira aceitar os Termos publicados.
Requisição: 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
}Resposta: 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
Registra um depósito na linha do tempo do suporte (rotas hyperevm, ethereum, arbitrum, solana, robinhood; no máximo 20 em andamento por usuário, 429 além disso).
Requisição: 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
}Resposta: 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"
]
}Códigos de erro
| Código | Status HTTP |
|---|---|
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 |
O stream da conta
GET /state/user/live é um stream de Server-Sent Events para uma carteira. Ele começa com um evento liveness que anuncia o intervalo do heartbeat, depois uma foto wallet e então patches wallet; eventos heartbeat mantêm a conexão viva.
| Evento | Conteúdo |
|---|---|
liveness |
|
wallet |
|
heartbeat | nenhum |
Canais públicos
As atualizações de todo o mercado são publicadas nestes canais:
trading:current
O frame de /state/trading, quando muda (no máximo uma vez por bloco).
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
As operações públicas de cada bloco.
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
A pressão da fila do relayer (publicada como texto JSON, com recuperação e compressão delta).
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
O resumo do protocolo, quando muda.
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
O resumo da casa, quando muda.
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"
]
}