← Protocols
SX Network
Prediction Market·EVM (SX Network L1, SX Rollup)

SX Network

01Description

Sports-focused EVM L1 (formerly SportX) with a native non-custodial prediction market exchange (SX.bet). Hybrid orderbook: orders are signed offchain (EIP-712) and settled onchain with no protocol fees.

02Best for
  • 01sports prediction market frontends
  • 02professional market-making bots
  • 03high-frequency betting apps
  • 04odds aggregators
  • 05Telegram betting bots
03Install
  • pnpm add ethers @sx-bet/sdk
04Environment variables
VariableScopeDescription
SX_BET_API_BASE_URLClientBase URL for the SX.bet REST API — defaults to https://api.sx.bet. Use https://api.toronto.sx.bet for the testnet.
SX_BET_PRIVATE_KEYServerPrivate key used to sign EIP-712 orders for posting/filling on the SX.bet exchange. Server-only.
SX_BET_ABLY_API_KEYServerAbly API key for realtime channels (orderbook, markets, trades). Optional — only needed for streaming subscriptions.
05Prompt snippet
Use the SX.bet API for sports prediction markets on SX Network. Discover markets via `GET https://api.sx.bet/markets/active` (filter by `sportXEventId` / `leagueId`) and pull odds with `GET /orders?marketHashes=...`. Place a bet by EIP-712 signing an order against the SX TokenTransferProxy and posting it to `POST /orders/new` (or `POST /orders/fill/v2` to take an existing order). Realtime orderbook + trade feeds ride Ably channels (`market_order_book:<marketHash>`, `recent_trades`); request a token via `POST /user/token` with your API key. Note: the legacy Ably feed is sunsetting July 1, 2026 in favor of native websockets — check the docs before wiring streaming.
06Gotchas
  • Hybrid model — orderbook is offchain, settlement is onchain. Always confirm a fill via `GET /trades?marketHashes=...` before debiting users; an order that 'posted' isn't an executed bet.
  • SX runs its own EVM L1; users must bridge to SX (typically from Polygon/Ethereum via the SX Bridge) before betting. Bake bridging UX into onboarding or expect drop-off.
  • Geo-restricted in the US, UK, France and several other jurisdictions. The hosted UI geofences; your frontend must do the same or risk regulatory exposure.
  • Realtime feeds use Ably — and the Ably gateway is being deprecated July 1, 2026. Plan a migration to the new native websocket endpoint before that date or live odds will silently stop updating.
  • Bet tokens vary (USDC, WSX, ETH) per market — read `market.baseToken` and approve the correct ERC-20 against the TokenTransferProxy before signing orders.
  • Resolution is handled by SX's reporting layer; disputed outcomes can be challenged via the SX governance flow but typically settle within hours, not minutes.
07Alternatives