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,yesorno, 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
Passfixture 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:
starts_after or
starts_before to reach it.
Search by text
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
celtfindsCeltics. - When few listings match, Lean also tries common team nicknames and city short forms, such as
phillyfor Philadelphia, and words one or two letters off, such asceltcs. - 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,limitandcursorwork the same as withoutsearch. Passnext_cursorback ascursorwith the samesearchto 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,sportor 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=nbafinds only the markets with such a listing, not every NBA market. To list a league, useleaguerather thansearch. - 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:
ainfindsSaintandMountain. Search for whole words. - If search is busy or cannot finish in time, the request returns
503 UPSTREAM_ERRORwith aRetry-Afterheader 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
rainfindsRainandRainfallbut notUkraine. 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_cursorback ascursorwith the samesearchand 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, returns503 UPSTREAM_ERRORwith aRetry-Afterheader. Wait that many seconds and try again, or narrow it withcategory,venueorends_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.periodis the part of the game the proposition covers.gameis the full game, overtime included.- In a spread,
group.subjectis the team that holds the negative line, andgroup.lineis that negative line. Inspread: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[].resolutionis how that venue settles its market, and any field can benull:source: how the venue resolved the market. It staysnulluntil the market resolves.result: once the leg isresolved,wonwhen the venue paid this outcome,lostwhen it did not, orvoidwhen the venue voided the market. It isnullon 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, ornullwhen Lean does not know it.
legs[].feesis what that venue charges a fill, with the same termsPOST /v1/orders/previewprices its fees with. It isnullon Kalshi, Polymarket US and Lighter, and when Lean has not recorded the venue’s fee for the market. See Fees.equivalencesays 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’srules) orunreviewed(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.
kindistime_windowfor a crypto window. Check it before you readfixtureandgroup, which only sports markets have.window.keynames 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 itsyesside and Down itsnoside. - A crypto listing takes
starts_after,starts_before,status,venue,limitandcursor.sport,league,fixture,groupandsearchare refused with400 VALIDATION_ERROR. - Books, prices, trades, candles and the
bookstream 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
gtdorioconly 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, itsyes 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
equivalenceis alwayssingle_venue. It has nofixtureorgroup, andlineisnull. outcomeis the venue side the market pays on,yesorno.titlereads 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,titlestarts with the event title, so it readsHighest temperature in Miami on Nov 24, 2026? 77° to 78°: Yes.event.keyandevent.titlename the venue event the market belongs to; the markets of one venue event share them.event.categoryiscryptofor an event about a coin’s price: one Polymarket or Polymarket US tagscrypto-prices, or bothcryptoandhit-price, and a Hyperliquid price outcome on a coin Hyperliquid lists itself (not a HIP-3 asset such asxyz: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 isuncategorizedwhen neither names one of the listed categories.event.ends_atis the venue market’s scheduled close, which is in the past for a market the venue still trades after it.- Pass a
categoryother thansportsorcrypto, orkind=event, to list event markets. Event coin-price markets arecategory=crypto, so list them withkind=event&category=crypto;category=cryptoalone lists crypto windows, which only Lighter has, socategory=cryptowith any othervenuereturns an empty page unless you passkind=event. - An event listing takes
category,venue(polymarket,polymarket_us,hyperliquidorkalshi),search,ends_after,ends_before,include_closed,limitandcursor.sport,league,fixture,group,starts_afterandstarts_beforeare refused with400 VALIDATION_ERROR, and so isstatus=closedwithoutinclude_closed=true.searchmatches whole words of titles and outcome names. - An event listing’s
next_cursorworks only with thecategory,venue,search,ends_after,ends_beforeandinclude_closedthat listed it. Sent with other values, it is refused with400 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
bookchannel naming itsmkt_…ID, and to its trades and status changes withtradesandmarket_lifecyclechannels naming its legticker. The stream has no quotes or fills channel; eachordersframe 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_startis 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, reasonROUTE_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, sovenuethere takes onlypolymarketorhyperliquid.
Closed event markets
An event listing holds only open, tradable markets unless you passinclude_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_afterdefaults to 48 hours ago andends_beforeto 30 days afterends_after. A wider or older window is refused with400 VALIDATION_ERROR. status=openwithinclude_closed=trueis refused, and so isinclude_closedon a sports or crypto window listing, or withsymbol.
Fees
Each leg’sfees 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.
{ "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.07at 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 abook 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
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.