Market lifecycle
A market as your wallet sees it: which callback arrives when a player trades and when the market ends.
<opId> is the platform’s id of one trade; the stake’s /bet and everything that later gives it back share it. <marketId> is the market’s id (a UUID), not its slug. <operatorId> is your operator’s id. How to answer each call is on Wallet callbacks.
| When | Call | reference | roundDetails |
|---|---|---|---|
| A player buys | /bet | <opId> | BUY |
| The buy spent less than its stake | /refund | <opId>:remainder | none |
The buy did not happen after its stake was taken, or its /bet got no readable answer | /refund, the whole stake | <opId> | none |
You refused the /bet | nothing | ||
| A player sells | /result, with no /bet before it | <opId> | SELL |
| A player places a limit BUY order | /bet | <opId> | PLACE_ORDER |
| A player places a limit SELL order | nothing: it reserves shares, not money | ||
| A trade fills a player’s limit order and owes the player money: a SELL order’s proceeds, or a filled BUY order’s unspent escrow | /result, one per player per trade | <fill opId>:book:<operatorId>:<playerId> | ORDER_FILL |
| A player cancels a BUY order, or trading on the market closes with it resting | /refund, the unspent escrow | <order opId>:cancel-refund | none |
| The market resolves and the player holds winning shares | /result | payout:<marketId>:<operatorId>:<playerId> | CLAIM, RESOLVED |
| The market is cancelled and the player is owed money back | /result (not /refund) | payout:<marketId>:<operatorId>:<playerId> | CLAIM, CANCELLED |
| The market pays the player nothing | nothing | ||
| The player session ends | /session/expired |
A market’s payout is sent by the platform; the player does not claim it.
Changed in v1.1 (Changes from v1.0): payouts are sent without a claim, under payout:<marketId>:<operatorId>:<playerId>. A cancelled market pays back through /result CLAIM CANCELLED, not /refund.
Buy
POST /refund
Content-Type: application/x-www-form-urlencoded
hash=6cfc04466ef07ddf0a4d340477cc5a19&userId=player-1001&reference=7c9e6679-7425-40de-944b-e07fc1f90ae7%3Aremainder&amount=0.37&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31×tamp=1793793600000A /bet you refuse, with any error other than 0 or 8, is followed by nothing:
HTTP/1.1 200
Content-Type: application/json
{
"error": 1,
"description": "Insufficient balance"
}A /bet whose answer the platform cannot read is followed by a /refund of the whole stake under the stake’s <opId>:
HTTP/1.1 503
Content-Type: application/json
{
"description": "Service Unavailable"
}POST /refund
Content-Type: application/x-www-form-urlencoded
hash=f6605684a330c4f4b1927f5e38f6eaf3&userId=player-1001&reference=7c9e6679-7425-40de-944b-e07fc1f90ae7&amount=12.50&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31×tamp=1793793600000Sell
A sell’s /result is the example on Wallet callbacks.
Limit orders
Limit orders are taken on binary markets only.
POST /bet
Content-Type: application/x-www-form-urlencoded
hash=2753cfdb0f54542bc15a5f70c5835580&userId=player-1001&token=5f2b9c0e7a1d4b3f8e6c2a9d0b7f4e1c&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31&amount=12.24&reference=a1e4c2d8-5b3f-4c9a-8e7d-6f0b1a2c3d4e×tamp=1793793600000&roundDetails=%7B%22action%22%3A%22PLACE_ORDER%22%2C%22outcomeKey%22%3A%22yes%22%2C%22direction%22%3A%22BUY%22%2C%22shares%22%3A%2220%22%2C%22limitPrice%22%3A%220.60%22%7DPOST /result
Content-Type: application/x-www-form-urlencoded
hash=260515172a3e27ee369c9f57d2fc7119&userId=player-1001&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31&amount=12.00&reference=c3b8e1f0-2d4a-4f6b-9c8e-7a5d3b1f0e2c%3Abook%3A3f1c2b7e-8a4d-4e6b-9c1a-2d5e7f0a1b3c%3Aplayer-1001×tamp=1793793600000&roundDetails=%7B%22action%22%3A%22ORDER_FILL%22%7DPayout
POST /result
Content-Type: application/x-www-form-urlencoded
hash=8ea4c5efea2221995b01eb4879fb824e&userId=player-1001&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31&amount=20.00&reference=payout%3Ae5d2a7b9-1c4f-4a6e-b8d3-9f0c2e1a7b54%3A3f1c2b7e-8a4d-4e6b-9c1a-2d5e7f0a1b3c%3Aplayer-1001×tamp=1793793600000&roundDetails=%7B%22action%22%3A%22CLAIM%22%2C%22status%22%3A%22RESOLVED%22%7DGive-backs
POST /refund
Content-Type: application/x-www-form-urlencoded
hash=fe209f9e6b12903022a4ceb0c2af2182&userId=player-1001&reference=a1e4c2d8-5b3f-4c9a-8e7d-6f0b1a2c3d4e%3Acancel-refund&amount=12.24&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31×tamp=1793793600000Cancelled market
POST /result
Content-Type: application/x-www-form-urlencoded
hash=b9a7104b82a29516e2486cd88586c9e4&userId=player-1001&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31&amount=12.50&reference=payout%3Ae5d2a7b9-1c4f-4a6e-b8d3-9f0c2e1a7b54%3A3f1c2b7e-8a4d-4e6b-9c1a-2d5e7f0a1b3c%3Aplayer-1001×tamp=1793793600000&roundDetails=%7B%22action%22%3A%22CLAIM%22%2C%22status%22%3A%22CANCELLED%22%7D