Skip to main content
Lean trades on four venues: Kalshi, Polymarket, Polymarket US and Hyperliquid. One market can list on several of them, and Lean reads every listing’s book, prices the order across them and places it where it fills best. This page shows what each venue supports, so you know where an order can go before you send it. Wherever a request or response names a venue, venue is one of kalshi, polymarket, polymarket_us or hyperliquid.

What each venue supports

Accounts and venue API keys

Polymarket and Hyperliquid balances belong to a trading account. Each trading account has its own cash and shares there. Kalshi and Polymarket US accounts belong to the user. Every trading account and API key of the user shares the same Kalshi and Polymarket US cash and shares, so GET /v1/balances and GET /v1/positions show the same figures for those venues under each of them. A live order on Kalshi or Polymarket US goes out under the user’s own API key for that venue. Connect it once in the Lean app:
  • Without it, a live order that needs that venue is refused with 403 FORBIDDEN. Connect the key, or leave the venue out with venues.
  • Test keys never reach a venue, so test orders on Kalshi and Polymarket US need no venue key.

Naming markets

Each venue listing of a market is a leg with its own ticker: GET /v1/markets?symbol= takes any of these tickers and lists the markets that trade it, so you can find the Lean market ID for a Kalshi or Polymarket US market. GET /v1/markets?venue= lists only markets with a leg on that venue. Store the market ID and use it everywhere else. See Market IDs.

Cash on each venue

Lean routes an order only to the venues that can pay for it. Between Polymarket and Hyperliquid, a buy can pay with cash on the other venue: Lean moves the cash and buys on the venue with the book, in the same call, and the order’s route says so. A buy on Kalshi or Polymarket US pays with the cash already on that venue. Shares never move between venues, so a sell or a stop loss sells on the venue that holds the shares. A test key starts with 10,000 simulated on each venue: USD on Kalshi and Polymarket US, pUSD on Polymarket and USDC on Hyperliquid.

Order terms on each venue

Each venue takes prices only on its own tick: limit_price must sit on the tick of every venue that could place the order. Lean never rounds it. Some order terms narrow the venues an order can reach:
  • A post_only order rests on Kalshi, Polymarket US or Hyperliquid. Polymarket can’t rest a post only order.
  • A gtd order goes to Kalshi, Polymarket or Polymarket US. Hyperliquid has no order expiry.
  • A fok order goes whole to one venue: Polymarket, else Kalshi, else Polymarket US. Hyperliquid has no fill or kill. Polymarket takes a fok buy sized with notional only, so a fok buy sized with quantity goes to Kalshi or Polymarket US.
When no venue that lists the market can take the order, it is refused with 400 VALIDATION_ERROR. See Orders for every term.

Polymarket US books

Lean reads Polymarket US books from a live copy that starts on the first read of a market. Until that copy is ready, a quote, preview or order that needs the book answers 503 UPSTREAM_ERROR with a Retry-After header, and nothing is placed. Send the same request again after that time.