Skip to main content
Who it’s for: sportsbooks, B2B odds providers and fantasy operators carrying one sided liability on a match. What you build: an automatic hedger. When liability on an outcome crosses a threshold, it buys the other side on prediction market liquidity.

Call sequence

1

Trigger

Your liability feed crosses a threshold. Find the market with List markets.
2

Price and place the hedge

Quote a market → Preview an order → Place an order. If the cash is on the other venue, the same call moves it and buys.
3

Track and unwind

Confirm each hedge with Get an order and List fills, and watch cash with Get balances. When liability falls, unwind with a sell through Place an order.

Starter

Guardrails

  • Price protection. limit_price sets the worst price you pay for the hedge.
  • Fill or nothing. time_in_force: ioc with all_or_none places the hedge only if the books can fill the full size now. It is best effort: a book can move before the fill, so a partial hedge is still possible. See All or none. Polymarket takes ioc buys by dollar amount only, so a hedge sized with quantity fills on Hyperliquid.
  • One hedge per trigger. Derive client_order_id from the match and trigger (for example hedge-match123-1). If your hedger fires twice, the second call returns the first order.
  • Spending caps. The key’s per order and rolling 24 hour limits bound how much any hedger can spend.
  • Kill switch. Pause order placement stops the hedger in one call.