Skip to main content
Every market has a kind:
  • sports: one outcome of one proposition of one fixture. For example: “DEN” in “DEN -3.5” in “Denver Broncos at Los Angeles Chargers”. Listed by default.
  • time_window: one outcome of a coin’s price over a fixed window. See Crypto windows.
  • event: one side, yes or no, of a single Polymarket, Polymarket US, Hyperliquid or Kalshi market about anything else, such as an election, a central bank decision or a coin price. See Event markets.

Query parameters

Season futures start later than 30 days ahead; pass starts_before to list them. Their market IDs resolve at any time. A parameter the endpoint does not take is refused with 400 VALIDATION_ERROR, so a misspelled filter never returns the whole list. List markets lists every parameter.

One proposition of one fixture

Pass fixture and group together to list the outcomes of one proposition, such as every driver in one race’s winner market, without paging through the whole league:
Take both keys from a market you already have. Both filters combine with the others, and the start window still applies: a fixture that starts outside it lists nothing, so pass starts_after or starts_before to reach it.

Search by text

On a sports listing, search finds markets the way the search box in the Lean app does. An event listing searches more simply; see Search in event listings.
  • Every word must appear, in any letter case, in the title of a Kalshi, Polymarket, Polymarket US or Hyperliquid listing of the market or of its game. The last word can be the start of a word, so celt finds Celtics.
  • When few listings match, Lean also tries common team nicknames and city short forms, such as philly for Philadelphia, and words one or two letters off, such as celtcs.
  • Only markets with a matching listing are returned, not every market of the same game.
  • Results keep the usual order by start time. league, sport, status, the start window, limit and cursor work the same as without search. Pass next_cursor back as cursor with the same search to read the next page.
  • A search looks only at the listings of games in the start window, and at no more than 10,000 matching ones, open listings first, then by start. Narrow broad words with league, sport or the start window.
  • The same search over the same listings returns the same markets every time.
  • League names are in only some listing titles, so search=nba finds only the markets with such a listing, not every NBA market. To list a league, use league rather than search.
  • Spaces at either end are ignored. The text must then be 1 to 100 characters, or the request returns 400 VALIDATION_ERROR.
  • A short word is close to many others, so near spellings make it match widely: ain finds Saint and Mountain. Search for whole words.
  • If search is busy or cannot finish in time, the request returns 503 UPSTREAM_ERROR with a Retry-After header rather than a partial list. Wait that many seconds and try again, or narrow a long start window.

Search in event listings

  • Every word must match a whole word, in any letter case, in the venue market’s title, its event’s title or its outcome names. The last word can be the start of a word, so rain finds Rain and Rainfall but not Ukraine. Add more words to narrow the list.
  • No team nicknames, short forms or near spellings are tried.
  • Results keep the event listing order, soonest close first. Pass next_cursor back as cursor with the same search and other filters to read the next page.
  • The text must be 1 to 100 characters once spaces at either end are removed, or the request returns 400 VALIDATION_ERROR.
  • An event listing that cannot finish in time, with or without search, returns 503 UPSTREAM_ERROR with a Retry-After header. Wait that many seconds and try again, or narrow it with category, venue or ends_before.

A market

title names the fixture, the proposition and the outcome in words, ready to show a person.

Fixture

Proposition (group)

group.kind is moneyline, spread, total, team_total or prop.
  • group.period is the part of the game the proposition covers. game is the full game, overtime included.
  • In a spread, group.subject is the team that holds the negative line, and group.line is that negative line. In spread:game:DEN:-3.5, DEN is the subject.

Signed line per outcome

line on each market is the line from that outcome’s point of view:

Legs

legs lists the venue listings behind the market. side is the venue side that pays when this outcome happens. status is the venue market’s status: unopened, open, closed, resolving or resolved, or null until Lean has recorded the venue market. The Lean platform shows a live book for every status but closed and resolved. tradable: true marks a leg the venue takes orders on now: a venue POST /v1/orders can place on, whose venue market is open and not marked untradable by the venue. An unopened or resolving leg has a live book but reads tradable: false, because its venue refuses orders. A market with no tradable leg is closed. Other legs are there for price discovery.
  • legs[].resolution is how that venue settles its market, and any field can be null:
    • source: how the venue resolved the market. It stays null until the market resolves.
    • result: once the leg is resolved, won when the venue paid this outcome, lost when it did not, or void when the venue voided the market. It is null on any other leg.
    • rules: the venue’s rules text, verbatim, with any secondary rules after a blank line. When the venue repeats its main rules as the secondary rules, the text appears once.
    • end_date: the venue’s end date, in ISO 8601.
    • url: the venue’s page for the market, or null when Lean does not know it.
  • legs[].fees is what that venue charges a fill, with the same terms POST /v1/orders/preview prices its fees with. It is null on Kalshi, Polymarket US and Lighter, and when Lean has not recorded the venue’s fee for the market. See Fees.
  • equivalence says how far the legs are known to match: single_venue (one venue lists it), verified (a reviewer confirmed each venue’s market is the same proposition, which does not mean the rules text is identical, so read each leg’s rules) or unreviewed (not yet checked). A venue listing a reviewer judged to be a different proposition is never listed as a leg.
GET /v1/markets/{id} returns one market in the same shape, or 404 NOT_FOUND.

Crypto windows

A crypto market is one outcome of a coin’s price over a fixed window. Lean lists Lighter’s BTC and ETH windows, each 15 minutes long. Every window has two markets: up pays when the price at the window end is at or above the price at its start, as the venue’s rules define them, and down pays when it is below.
  • kind is time_window for a crypto window. Check it before you read fixture and group, which only sports markets have.
  • window.key names the coin, the window length and its start in UTC. Both markets of a window share it.
  • The Up and Down markets of a window share one Lighter leg ticker: Up is its yes side and Down its no side.
  • A crypto listing takes starts_after, starts_before, status, venue, limit and cursor. sport, league, fixture, group and search are refused with 400 VALIDATION_ERROR.
  • Books, prices, trades, candles and the book stream channel work on crypto markets as on sports markets.
  • Previews and orders take a crypto market’s ID. Its orders expire with the window, so they take gtd or ioc only and cannot be amended. See Lighter for the full rules. Quotes, routed orders, stop losses and limit chases do not take crypto windows.

Event markets

An event market is one side of a single Polymarket, Polymarket US, Hyperliquid or Kalshi market that no sports fixture lists: an election, a central bank decision, a coin’s price on a date, and so on. Each venue market is two event markets, its yes side and its no side. Lean lists the ones that are open and take orders, soonest scheduled close first. A venue can keep a market trading after its scheduled close, such as a daily weather market that waits for the day’s reading, so a listing reaches back 48 hours unless you pass ends_after. Kalshi multivariate (parlay) markets, whose tickers start with KXMVE, are not listed.
  • An event market has exactly one leg, on the venue that lists it, so equivalence is always single_venue. It has no fixture or group, and line is null.
  • outcome is the venue side the market pays on, yes or no. title reads the venue’s question and that side’s label. When the venue names one outcome of a larger event only by its range or name, such as a Kalshi or Polymarket US daily temperature market, title starts with the event title, so it reads Highest temperature in Miami on Nov 24, 2026? 77° to 78°: Yes.
  • event.key and event.title name the venue event the market belongs to; the markets of one venue event share them. event.category is crypto for an event about a coin’s price: one Polymarket or Polymarket US tags crypto-prices, or both crypto and hit-price, and a Hyperliquid price outcome on a coin Hyperliquid lists itself (not a HIP-3 asset such as xyz:GOLD). Any other event takes Lean’s category for it; an event Lean has not categorized takes its Kalshi category: the one Kalshi files a Kalshi event under, else the Kalshi category Lean tags an event of another venue with. It is uncategorized when neither names one of the listed categories. event.ends_at is the venue market’s scheduled close, which is in the past for a market the venue still trades after it.
  • Pass a category other than sports or crypto, or kind=event, to list event markets. Event coin-price markets are category=crypto, so list them with kind=event&category=crypto; category=crypto alone lists crypto windows, which only Lighter has, so category=crypto with any other venue returns an empty page unless you pass kind=event.
  • An event listing takes category, venue (polymarket, polymarket_us, hyperliquid or kalshi), search, ends_after, ends_before, include_closed, limit and cursor. sport, league, fixture, group, starts_after and starts_before are refused with 400 VALIDATION_ERROR, and so is status=closed without include_closed=true. search matches whole words of titles and outcome names.
  • An event listing’s next_cursor works only with the category, venue, search, ends_after, ends_before and include_closed that listed it. Sent with other values, it is refused with 400 VALIDATION_ERROR.
  • GET /v1/markets/{id}, books, prices, quotes, trades and candles work on event markets as on sports markets. An event market’s ID resolves after it closes, so its orders, fills and positions keep naming it.
  • On the stream, subscribe to an event market’s book with a book channel naming its mkt_… ID, and to its trades and status changes with trades and market_lifecycle channels naming its leg ticker. The stream has no quotes or fills channel; each orders frame carries the order’s fills.
  • Event markets trade through the normal order API, on the one venue that lists them: previews, orders, amends, cancels, stop losses and limit chases all take an event market’s ID, with the same order types as a sports market. game_start is refused, because an event market has no start.
  • Sports markets keep smart order routing. An event market lists on one venue, so a routed order on it is refused with 422 VALIDATION_ERROR, reason ROUTE_NOT_EXECUTABLE; send a venue order instead.
  • Both sides of a Polymarket or Hyperliquid event market merge with POST /v1/positions/merge. Kalshi and Polymarket US have no merge, so venue there takes only polymarket or hyperliquid.

Closed event markets

An event listing holds only open, tradable markets unless you pass include_closed=true. With it, the listing also holds markets that closed, are resolving or resolved, or are not tradable yet. Add status=closed to list only the markets that are not tradable.
  • The window of scheduled closes must start no more than 30 days ago and span at most 30 days. ends_after defaults to 48 hours ago and ends_before to 30 days after ends_after. A wider or older window is refused with 400 VALIDATION_ERROR.
  • status=open with include_closed=true is refused, and so is include_closed on a sports or crypto window listing, or with symbol.
To follow resolutions as they happen, List recently resolved markets lists Kalshi and Polymarket events newest first.

Fees

Each leg’s fees lets you price a fill’s fee before you preview it: rate is taker_rate for a fill that takes liquidity and maker_rate for a resting order that fills. A Polymarket market with maker_rate: "0" charges only takers. Hyperliquid’s maker_rate is its lowest-volume tier. For example, a Polymarket leg with { "formula": "price_curve", "taker_rate": "0.05", "maker_rate": "0", "exponent": 1 }:
  • Buying 100 shares at 0.24 pays 100 × 0.05 × (0.24 × 0.76) = $0.912, so each share costs 0.24912 with its fee. If the outcome is worth 0.255 to you, the edge is 0.255 − 0.24912 = 0.00588 a share, not 0.015.
  • Selling 100 shares at 0.76 pays the same $0.912, because price × (1 − price) is the same.
And a Hyperliquid leg with { "formula": "notional_on_exit", "taker_rate": "0.0007", "maker_rate": "0.0004", "exponent": null }:
  • Buying 100 shares at 0.60 pays nothing.
  • Selling those 100 shares at 0.60 pays 100 × 0.60 × 0.0007 = $0.042.
  • Holding them to a win instead pays 100 × 1 × 0.0007 = $0.07 at settlement.
POST /v1/orders/preview and the quote price every fill at taker_rate from these same terms, and their expected_fee_usd and fee_usd are authoritative. When a Polymarket leg’s fees is null, they show a fee of 0 for it, which may be less than Polymarket charges. When a Hyperliquid leg’s fees is null, they price its sells at the base rate, 7 bps. A venue can change its fees, so preview an order before you place it.

Market IDs

A market ID (mkt_…) is stable and opaque. Store it and send it back unchanged. Do not build or edit IDs yourself. A mkt_… ID Lean did not issue, or one that names a team outside its fixture, returns 404 NOT_FOUND.

Venue symbols

Every field and path that takes a market ID, including a book channel on the stream, also takes a venue symbol that names exactly one market: A Kalshi or pmus: ticker works only when that listing pays a single outcome. Most Kalshi and Polymarket US game listings pay both teams, so name those markets by market ID. To find the market ID from a ticker, use GET /v1/markets?symbol=. Lean answers with the market under its market ID, so a market never appears under two IDs. Orders, fills and filters store and compare the market ID: listing orders by a token ID returns the same orders as listing them by the market ID. An order named by a venue symbol trades only that listing. If venues leaves out the symbol’s venue, the order is refused with 422 and details.reason: "NO_EXECUTABLE_VENUE". A buy Lean routes for you still buys that listing, paid from the other venue, which happens only between Polymarket and Hyperliquid. Reads that price a market price what an order naming the same ID would trade. With a venue symbol, the quote, book, trades, prices and book stream channel read only the symbol’s listing, under the market ID. With a market ID they read every listing. GET /v1/markets/{id} describes the whole market either way. A symbol that names more than one market returns 400 VALIDATION_ERROR. The ticker or Polymarket condition ID of a listing that pays both outcomes names both of its markets, and so does a Lighter lt: ticker; send the token ID, the book coin or the market ID instead. Most event market tickers name both the yes and the no market, so look them up with GET /v1/markets?symbol=, which lists every market a symbol names. A symbol Lean does not list returns 404 NOT_FOUND, and a value that is neither a market ID nor a venue symbol returns 400 VALIDATION_ERROR.

Prices

GET /v1/prices reads the top of the book for up to 25 markets, separated by commas. More than 25 returns 400 VALIDATION_ERROR with market_ids: At most 25 market ids per request; split larger sets across requests. Ids that name no market are listed in not_found. A best price backed by a few shares fills only those shares there. Size an order against the quantity, or read the book for the depth behind it. Polymarket quantities include what the opposite outcome’s book implies; Hyperliquid quantities are the venue’s book as it stands.

Quotes and liquidity

A quote shows how a buy of quantity shares would fill across venues. Send action=sell to quote a sell of shares the trading account holds. For a buy, send notional instead of quantity to quote the shares a dollar amount buys, as a buy sized with notional would be placed. A quote prices a market order, within the account’s slippage bound when it sets one (max_slippage_bps in GET /v1/account/config), on the venues orders can use. limited_by is one of: When nothing could be placed, legs is empty and quantity is 0. New limited_by values can appear without a new version; treat one you do not recognize as covering only part of the quantity. If routing is not available, the quote returns 503 FEATURE_DISABLED. Markets, previews and orders still work.

Recent trades

GET /v1/markets/{id}/trades lists the trades on each venue listing of the market, newest first. To read further back, pass the page’s next_cursor as cursor. Each page holds trades strictly older than the last trade of the page before. next_cursor is null when no older trade is recorded. limit sets how many trades a page holds: 50 by default, at most 100. A cursor works only for the market and venue it was issued for. A cursor Lean did not issue, or one passed with another market or venue, returns 400 VALIDATION_ERROR.

Price candles

GET /v1/markets/{id}/candles returns open, high, low, close and volume for each venue listing of the market, oldest first. Pass venue to read one listing. One call returns at most 1000 candles per listing. A range longer than that, a start that is not before end, or an unknown interval returns 400 VALIDATION_ERROR. So does a range that starts before 1970 or runs past early 2106, with start and end are outside the supported time range. An unknown market returns 404 NOT_FOUND. Prices are dollars per share of the side the market buys. A period with no trade has no candle, and the period still open may be missing or hold only the trades so far. A period the Lean chart treats as unpriced has no candle either: a recorded open of 0 or close below 0.001, read before a Polymarket NO market’s prices are turned over.