Skip to content

Markets

Describes stx-python 0.10.1, the current release.

What a market is and how it moves through its statuses is covered in Concepts; every field is in the API reference. This page shows the SDK calls.

markets() calls GET /api/v1/markets and returns one Page of stx.models.Market:

from stx import STX
with STX() as client:
page = client.markets(status=["pre_open", "open"], trading=True, limit=10)
for m in page:
print(m.market_id, m.status, m.symbol, m.last_traded_price)
print(len(page), "markets; more:", page.has_more)

Sample output:

e00651a3-10cb-4bc1-9e1f-c5ea1796c83b open STXNHL-26OCT101600EDMSJ-GAMEEDM 0.5800
b5b38620-6d92-4f15-a243-f0cf47ee0523 open STXNHL-26OCT101600EDMSJ-SOGSJCMCDAVID209555-3.5 0.5200
2 markets; more: True
Argument Meaning
market_ids, event_ids One id or a list
status One status or a list: scheduled, pre_open, open, closed, resulted, cancelled, voided
trading True for markets accepting orders now
sports, competitions Exact names as the market carries them, e.g. "Hockey", "NHL"
sort_by, sort_direction "event_start", and "asc" or "desc"
limit Page size, default 100, maximum 200
cursor The cursor of the previous page

Filters combine with AND; a list matches any of its values.

Every list endpoint pages by cursor. page.cursor is None on the last page. Pass it back for the next one, or let an iter_ method follow it for you:

from itertools import islice
from stx import STX
with STX() as client:
first = client.markets(status="open", limit=2)
if first.cursor:
second = client.markets(status="open", limit=2, cursor=first.cursor)
print([m.symbol for m in second])
walked = list(islice(client.iter_markets(status="open", limit=50), 120))
print("walked", len(walked), "markets across pages")

iter_markets, iter_events, iter_orders, iter_fills, iter_settlements, iter_deposits, iter_withdrawals, iter_adjustments, iter_fees, iter_loyalty and iter_account_market_stats all work the same way. On AsyncSTX they are async iterators (async for).

There is no single-market route; market(market_id) asks markets() for that id and raises STXNotFoundException when there is none:

from stx import STX
with STX() as client:
some_id = client.markets(limit=1)[0].market_id
market = client.market(some_id)
print(market.title)
print("rules", market.rules, "max", market.max_price, "delay", market.in_play_delay_sec)

Sample output:

NHL EDM @ SJ
rules away_winner max 1.0000 delay 5

Selected fields of stx.models.Market; every field is on the API reference.

Field Type Notes
market_id, event_id str UUIDs
symbol, title, short_title, question str
status str See market status
trading bool Accepting orders now
max_price str What a winning contract pays, e.g. "1.0000". Read it per market; orders price strictly below it
price, last_traded_price str or None Dollars
bids, offers List[BookLevel] Each level has price and quantity strings. Both run from the highest price to the lowest: the best bid is bids[0], the best offer is offers[-1]
recent_trades List[RecentTrade] price, quantity, timestamp, liquidity_taker
volume24h, total_volume, open_interest str or None Contracts
event_start str ISO 8601
in_play_delay_sec int Queue delay while the event is in progress

Fields the server adds before the SDK knows them are kept: read them as attributes or from model_dump().

from stx import STX
with STX() as client:
for event in client.events(status="scheduled", sort_by="start_time", sort_direction="asc", limit=5):
print(event.start_time_iso, event.sport, event.title)

Sample output:

2026-10-10T20:00:00.000000Z Hockey Edmonton Oilers at San Jose Sharks

events() takes event_ids, sports, competitions, event_types, title, status (scheduled, in_progress, completed, cancelled), promoted, sort_by="start_time", sort_direction, limit and cursor. Pass sort_direction whenever you pass sort_by: "asc" lists the soonest events first.

markets() returns the book as it stood when you asked. To follow a book, subscribe to the orderbook channel; for price changes across many markets, ticker. See WebSockets.

STX is operated by XV Exchange, LLC, a Designated Contract Market regulated by the U.S. Commodity Futures Trading Commission (CFTC). Contracts traded on STX are cleared by XV Clearing, LLC, a CFTC-registered Derivatives Clearing Organization. Trading involves substantial risk of loss and may not be appropriate for everyone. Members risk losing the cost to enter any transaction, including fees. Consider whether trading is appropriate for you in light of your experience and financial resources. Nothing on this site is investment advice or a recommendation to trade. Past performance is not indicative of future results.

© 2026 STX. All rights reserved.llms.txtllms-full.txtView as Markdown
Docs version v1.10.5