Skip to main content
Who it’s for: prop desks, funds and market makers who trade sports outcomes on more than one venue. What you build: an execution layer that gets one fill at the best combined price across Polymarket and Hyperliquid, without integrating either venue yourself.

Call sequence

1

Find the market

List markets (filter by league, sport or starts_after), then Get a market.
2

See the depth

Quote a market prices a size across venues. Get a market orderbook shows each venue’s book.
3

Preview

Preview an order returns the plan: the legs per venue, the executable quantity and the slippage check. Nothing is sent.
4

Place it

Place an order with the same body. Lean places the legs on the venues the plan chose. Set client_order_id so a retry returns the same order.If the cash is on one venue and the book on the other, the same call moves the cash and buys, and route in the response names both venues. See Paying from the other venue.Set best_price: true to take that route whenever it costs less than buying where the cash is, even when the cash would cover the buy. See Best price across venues.
5

Follow and reconcile

Create a stream ticket to follow order, position and balance updates over the WebSocket, then confirm with Get an order and List fills.

Starter

Guardrails

  • Price protection. limit_price is the worst price per share you accept, and max_slippage_bps bounds how far each venue order may trade from that venue’s own best price, so venues quoting different prices can each fill. limit_price caps every venue alike.
  • Fill or nothing. all_or_none with time_in_force: ioc places the order only if the books can fill the whole quantity. It is best effort: a book can move before the fill, so a partial fill is still possible. See All or none. Polymarket takes ioc buys by dollar amount only, so a buy sized with quantity fills on Hyperliquid.
  • Safe retries. The same client_order_id always returns the same order.
  • Spending caps. Every order is checked against the key’s per order and rolling 24 hour limits before it reaches a venue.
  • Precise sizing. Quantities are in steps of 0.01 shares.