Skip to content

Matcher API

The Matcher is an internal CLOB (Central Limit Order Book) engine. It handles order intake, price-time matching, and on-chain settlement. The backend calls the matcher — the frontend should not call it directly.

Base URL: https://clob-production.up.railway.app

Internal Service

The matcher is designed to be called by the backend only. Do not expose it to the public internet without proper access controls.

Endpoints

system

Health and stats


Health check

GET
/health

Responses

Default Response

application/json
JSON
{
  
"ok": true
}

Playground

Samples


Matcher stats

GET
/stats

Responses

Default Response

application/json
JSON
{
  
"openOrders": 0
}

Playground

Samples


markets


Register a token pair in backend storage

POST
/markets/token-pairs

Request Body

application/json
JSON
{
  
"tokenId": "string",
  
"complementTokenId": "string",
  
"conditionId": "string",
  
"question": "string",
  
"questionId": "string",
  
"outcomeSlotCount": 0
}

Responses

Default Response

application/json
JSON
{
  
"ok": true
}

Playground

Server
Body

Samples


List markets with token pairs

GET
/markets

Responses

Default Response

application/json
JSON
{
  
"markets": [
  
  
{
  
  
  
"conditionId": "string",
  
  
  
"question": "string",
  
  
  
"questionId": "string",
  
  
  
"outcomeSlotCount": 0,
  
  
  
"tokenPairs": [
  
  
  
  
{
  
  
  
  
  
"tokenId": "string",
  
  
  
  
  
"complementTokenId": "string",
  
  
  
  
  
"conditionId": "string"
  
  
  
  
}
  
  
  
]
  
  
}
  
]
}

Playground

Samples


Get a market by condition id

GET
/markets/{conditionId}

Parameters

Path Parameters

conditionId*
Type
string
Required

Responses

Default Response

application/json
JSON
{
  
"market": {
  
  
"conditionId": "string",
  
  
"question": "string",
  
  
"questionId": "string",
  
  
"outcomeSlotCount": 0,
  
  
"tokenPairs": [
  
  
  
{
  
  
  
  
"tokenId": "string",
  
  
  
  
"complementTokenId": "string",
  
  
  
  
"conditionId": "string"
  
  
  
}
  
  
]
  
}
}

Playground

Server
Variables
Key
Value

Samples


Delete a market and all related data by condition id

DELETE
/markets/{conditionId}

Parameters

Path Parameters

conditionId*
Type
string
Required

Responses

Default Response

application/json
JSON
{
  
"ok": true
}

Playground

Server
Variables
Key
Value

Samples


orders


List recent orders

GET
/orders

Parameters

Query Parameters

account
Type
string
conditionId
Type
string
limit

Responses

Default Response

application/json
JSON
{
  
"orders": [
  
  
{
  
  
  
"orderHash": "string",
  
  
  
"tokenId": "string",
  
  
  
"maker": "string",
  
  
  
"signer": "string",
  
  
  
"taker": "string",
  
  
  
"side": 0,
  
  
  
"signatureType": 0,
  
  
  
"makerAmount": "string",
  
  
  
"takerAmount": "string",
  
  
  
"remainingMakerAmount": "string",
  
  
  
"expiration": "string",
  
  
  
"nonce": "string",
  
  
  
"feeRateBps": "string",
  
  
  
"salt": "string",
  
  
  
"signature": "string",
  
  
  
"status": "string",
  
  
  
"conditionId": "string",
  
  
  
"price": "string",
  
  
  
"lastSettlementTxHash": "string",
  
  
  
"createdAt": "string",
  
  
  
"updatedAt": "string"
  
  
}
  
]
}

Playground

Server
Variables
Key
Value

Samples


Submit a signed order

POST
/orders

Request Body

application/json
JSON
{
  
"conditionId": "string",
  
"order": {
  
  
"salt": "string",
  
  
"maker": "string",
  
  
"signer": "string",
  
  
"taker": "string",
  
  
"tokenId": "string",
  
  
"makerAmount": "string",
  
  
"takerAmount": "string",
  
  
"expiration": "string",
  
  
"nonce": "string",
  
  
"feeRateBps": "string",
  
  
"side": "string",
  
  
"signatureType": "string",
  
  
"signature": "string"
  
}
}

Responses

Default Response

application/json
JSON
{
  
"orderHash": "string",
  
"status": "string",
  
"match": {
  
  
"matchId": 0,
  
  
"makerOrderHash": "string"
  
}
}

Playground

Server
Body

Samples


Mark an order as locally cancelled

POST
/orders/cancel

Request Body

application/json
JSON
{
  
"orderHash": "string"
}

Responses

Default Response

application/json
JSON
{
  
"ok": true
}

Playground

Server
Body

Samples


Get order and event history

GET
/orders/{hash}

Parameters

Path Parameters

hash*
Type
string
Required

Responses

Default Response

application/json
JSON
{
  
"error": null
}

Playground

Server
Variables
Key
Value

Samples


Get orderbook by token id

GET
/orderbook/{tokenId}

Parameters

Path Parameters

tokenId*
Required

Responses

Default Response

application/json
JSON
{
  
"error": null
}

Playground

Server
Variables
Key
Value

Samples