What is the orderbook?
The orderbook is the collection of all active, unfilled orders for a given market. Every order in the book is a maker’s open ask to bet on a specific outcome at specific odds.
When you fetch orders from the API, you’re reading the live orderbook from the maker’s perspective.
Orders on the SX Bet API are always from the maker’s perspective.
Reading an order
Each order in the API response contains:
The critical fields for understanding an order:
| Field | What it tells you |
|---|
marketHash | The market this order belongs to |
isMakerBettingOutcomeOne | Which side the maker is on (true = backing outcome 1, false = outcome 2) |
percentageOdds | The maker’s implied odds — divide by 10^20 to get a decimal (e.g. 0.51 = 51%) |
totalBetSize | The maker’s total stake (USDC, 6 decimals) |
fillAmount | Already filled portion — available = totalBetSize - fillAmount |
Converting Odds to Taker’s Perspective
To bet on outcome 1 as a taker, you need to find orders where the maker is betting on outcome 2 — because you’re taking the other side.
The isMakerBettingOutcomeOne field tells you which side a maker has taken:
isMakerBettingOutcomeOne | Maker is betting on | You can use this order to bet on |
|---|
true | Outcome 1 | Outcome 2 |
false | Outcome 2 | Outcome 1 |
Let’s take a real market — Cleveland Cavaliers vs Boston Celtics (moneyline) — and trace how raw maker orders from the API become the taker orderbook you see on sx.bet.
- Outcome 1 = Cleveland Cavaliers
- Outcome 2 = Boston Celtics
Step 1: Raw maker orders from GET /orders
Each row is labeled so you can trace it into the taker orderbook below.
Step 2: What the taker sees on sx.bet
Those maker orders create the following orderbook for takers.
The taker’s price = 1 - (percentageOdds / 10^20). Best taker odds are at the top.
| Outcome 1 |
|---|
| Cleveland Cavaliers |
|---|
| Size | Taker Price |
|---|
| D | $292.19 | 53.25¢ |
| B | $530.00 | 54.0¢ |
| C | $4,836.78 | 54.0¢ |
| A | $758.99 | 58.0¢ |
| Outcome 2 |
|---|
| Boston Celtics |
|---|
| Size | Taker Price |
|---|
| G | $999.65 | 48.0¢ |
| H | $752.00 | 48.0¢ |
| F | $799.00 | 48.5¢ |
| E | $4,616.06 | 50.0¢ |
Converting Maker Bet Sizes to Available Liquidity
Like percentageOdds, totalBetSize and fillAmount for a given order are from the maker’s perspective. To find how much liquidity is available for a taker to fill, you will need to convert the remaining maker space (totalBetSize - fillAmount) into taker space.
On any given bet, the maker’s stake and the taker’s stake together form the total payout pool. The maker posts an order at their implied odds (percentageOdds / 10^20), so the total pot for any filled amount is makerStake / makerOdds. The taker’s maximum stake is that total pot minus the maker’s stake.
Example
So while 6.00 USDC of maker stake remains, a taker can fill up to ~5.43 USDC on the other side.
In code