Documentation Index
Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When you fill an order on SX Bet, you set adesiredOdds and an oddsSlippage. Together, these control the worst weighted average odds you’re willing to accept.
oddsSlippage = 0— only fill atdesiredOddsor betteroddsSlippage = 3— accept up to 3% worse thandesiredOddson a weighted average basis
oddsSlippage field is an integer from 0 to 100 representing a percentage.
Why slippage exists
Between the moment you submit a fill and the moment the exchange matches it (after the betting delay), the orderbook can change:- The order you targeted may get cancelled by the maker
- Another taker may fill the order before you
- The maker may update their odds by cancelling and reposting
- For in-play markets, odds shift constantly as the game progresses
How slippage is calculated
Slippage applies to the weighted average odds across all orders your fill matches — not to each individual order. The exchange checks:desiredOdds, as long as the overall weighted average stays within your slippage tolerance.
Example 1: Filling across multiple price levels
You submit a fill for $10,000 atdesiredOdds of 2.10 with 5% slippage.
The orderbook has taker liquidity at these levels:
| Taker odds | Available liquidity |
|---|---|
| 2.10 | $2,000 |
| 2.09 | $3,000 |
| 2.07 | $15,000 |
| Taker odds | Amount filled | Contribution to average |
|---|---|---|
| 2.10 | $2,000 | 4,200 |
| 2.09 | $3,000 | 6,270 |
| 2.07 | $5,000 | 10,350 |
2.10 * (1 - 0.05) = 1.995. Since 2.082 > 1.995, the fill succeeds — even though some of the liquidity was at 2.07.
Example 2: Slippage protects you from filling at bad odds
Slippage is based on your weighted average across all matched orders. If the orderbook is mostly stale or far off your target price, the weighted average will fall below your threshold and the fill will fail — protecting you from getting a bad price. You submit a fill for $50 atdesiredOdds of 2.30 with 3% slippage.
The orderbook has:
| Taker odds | Available liquidity |
|---|---|
| 2.30 | $10 |
| 2.00 | $40 |
2.30 * (1 - 0.03) = 2.231.
The exchange would need to fill across both levels:
| Taker odds | Amount filled | Contribution to average |
|---|---|---|
| 2.30 | $10 | 23.00 |
| 2.00 | $40 | 80.00 |
ODDS_STALE error rather than being filled at a price far from what you intended.
Choosing a slippage value
| Scenario | Recommended slippage | Reasoning |
|---|---|---|
| Pre-game markets | 0 | Odds are stable; you want exactly what you see |
| Pre-game, large fills | 1–2 | Slight tolerance for orders getting taken between submission and matching |
| In-play markets | 3–5 | Odds shift constantly; some tolerance prevents repeated failures |
| Fast-moving in-play | 5–10 | Prioritize execution over price precision |
Error: ODDS_STALE
If the exchange can’t find any orders within your slippage tolerance, it returns an ODDS_STALE error. This means:
- The orders that existed when you checked have been filled or cancelled
- The remaining liquidity is at odds worse than your
desiredOddsplus slippage allows
Related
Filling Orders →
Full guide to filling orders as a taker.
POST /orders/fill/v2 →
Full API reference for the fill endpoint.
Odds Formats →
Converting between implied, American, and decimal odds.
Navigating the Orderbook →
Reading orderbook depth and finding the best prices.
