The SX Bet API represents odds as an implied probability stored as a fixed-point integer with 20 decimal places (units of 10^20).
Examples
percentageOdds value | Implied probability | American odds (approx) |
|---|
60000000000000000000 | 60.00% | -150 |
52500000000000000000 | 52.50% | -111 |
50000000000000000000 | 50.00% | +100 |
40000000000000000000 | 40.00% | +150 |
Converting in code
percentageOdds values are very large integers. Use BigInt in JavaScript to avoid precision loss when doing arithmetic.
Taker odds
When you fill an order, you automatically receive the complementary odds:
For example, if a maker posts an order with desired odds of 52.25% implied odds on outcome 1, the taker gets 47.75% implied odds on outcome 2.
Token amounts (USDC)
All stake and payout amounts are in USDC with 6 decimal places.
Examples
| Raw value | Human-readable |
|---|
1000000 | $1.00 |
10000000 | $10.00 |
5500000 | $5.50 |
Converting in code
Calculating payout
For a given fill: