When you fill an order on SX Bet, you set a desiredOdds and an oddsSlippage. Together, these control the worst weighted average odds you’re willing to accept.
oddsSlippage = 0 — only fill at desiredOdds or better
oddsSlippage = 3 — accept up to 3% worse than desiredOdds on a weighted average basis
The oddsSlippage field is an integer from 0 to 100 representing a percentage.
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
Without slippage, any of these changes would cause your fill to fail entirely. With a small slippage tolerance, your bet can still go through at slightly worse odds rather than failing outright.
This means individual orders in your fill can have odds worse than your desiredOdds, as long as the overall weighted average stays within your slippage tolerance.
You submit a fill for $10,000 at desiredOdds 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
The exchange fills your $10,000 across all three levels:
Taker odds
Amount filled
Contribution to average
2.10
$2,000
2,000×2.10=4,200
2.09
$3,000
3,000×2.09=6,270
2.07
$5,000
5,000×2.07=10,350
Weighted average odds = (4,200+6,270 + 10,350)/10,000 = 2.082Your minimum acceptable odds = 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 at desiredOdds of 2.30 with 3% slippage.The orderbook has:
Taker odds
Available liquidity
2.30
$10
2.00
$40
Your minimum acceptable odds = 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
10×2.30=23.00
2.00
$40
40×2.00=80.00
Weighted average odds = (23.00+80.00) / $50 = 2.06Since 2.06 < 2.231, the fill fails. The 2.00 liquidity drags the weighted average well below your threshold, so you receive an ODDS_STALE error rather than being filled at a price far from what you intended.