API
The board, the feed, the leaderboards and the history on sagitta.broker come from a public HTTP API, and anyone may call it. Pots, holdings and tickets that have to be current are read from Elysium itself (see Trading on the site).
| Item | Value |
|---|---|
| Base URL | https://api.sagitta.broker |
| Reference | api.sagitta.broker/api: every endpoint, field and example, with a “try it” button |
| OpenAPI | /api?spec=1, OpenAPI 3.1, generated from the same schemas the server and the site validate with |
| Format | JSON over HTTPS; public GETs need no headers and allow any origin |
| Limits | 2 calls a minute per IP address without a key, 30 per key with a free one. See Limits and API keys |
| Transactions | The API never signs. POST /api/arena answers with transactions for your own key. See Agents |
Shapes
Section titled “Shapes”- Amounts are HYPE in fields ending in
_hype(pot_hype,worth_hype,nav_hype,owed_hype); raw amounts are wei, as decimal strings. - A transaction comes back as
{ tx: { to, data, value, chainId }, summary }. - Each market carries its
status,mint_open,accrued_burn_hype(the burn sharecollectFees()would send to the burn vault now), itsbadge, which says where its price comes from (relayedon every market here), and its reading status: the observation time its oldest waiting ticket needs, and whether a round that fills it is in. - A stock market is a
stockrow with the token’sissuerand itsticker. Its prices are share prices, the price per token a wallet shows: each signed per-base-unit price divided by the token’s multiplier in force now, so they move when the issuer changes the multiplier while the signed answers stay as signed. Itssessionsays where the stock’s session stands by its issuer’s hours:open,closedon a US market holiday orweekendfor a token that follows the US equity session (Ondo’s), andnullfor a token that trades around the clock (see Weekends and market hours). /api/marketsalso carriesburn: the burn vault’s balance and its running totals (BurnVault.totals(): deposited, spent and burned), and the burn share the markets still hold.
Endpoints
Section titled “Endpoints”| Path | Returns | Source |
|---|---|---|
/api/markets |
All markets at once, as the board shows them, stocks first | The indexer’s listings, each market read on chain, and its applied readings as the price series |
/api/feed |
Recent activity across every market, or for a single market or wallet | Every commit, fill, refund, reading, claim, tip, listing and burn the contracts emit |
/api/readings |
Every relayed round posted to a market’s feed, with the keys that signed it and the transaction that posted it. See Readings | Each relayed feed’s Posted events |
/api/winners, /api/leaders |
Closed gains, the 24 h race, profit and referral boards; largest wallets, holders, busiest wallets | Holdings at average cost per market, side and epoch, and every exit’s gain or loss |
/api/arena |
GET: a wallet’s holdings, the market list and open upkeep. POST: transactions for buy, sell, execute, poke, claim and retire. See The trading API |
The indexer and the chain; POST builds with the SDK and checks every payee on chain |
/api/portfolio |
One wallet’s whole book in one call (?wallet=): every holding at the board’s NAV, its pending tickets, its HYPE and the HYPE each market owes it, with totals in HYPE and USD |
The indexer’s positions and tickets; the wallet’s HYPE and owed HYPE read on chain in one batch |
/api/ref |
One wallet’s referral earnings | The markets’ FeesAccrued events |
/api/price |
{ hypeUsd, at }: HYPE in US dollars, for the site’s dollar figures; hypeUsd is null once the feed’s newest round is more than 2 hours old |
The HYPE / USD relayed feed’s newest round (see HYPE in US dollars). A display price only: no market reads it |
/api/deployment |
The factory versions (each one’s markets, whether it takes new listings, is sunset or paused), the Registry, the timelock and the guardian, and whether trading is open, with the reason when it isn’t | The Registry |
/api/og |
A share card: a 1200 × 630 PNG for a market (?m=), a wallet (?owner=) or the site |
The board’s market data and the indexer’s positions |
/api/page |
The link preview of one page of the site (?path=/m/sol-usd): its title, description, canonical URL and card |
The same |
/tokenlist.json |
Every side token as a token list, in the Uniswap token-list format | The indexer |
/api/keys/challenge, /api/keys |
A free API key for a wallet signature: the message to sign, then the key (POST) or its revocation (DELETE). See API keys |
The API’s own key records |
The API serves no JSON-RPC. To read the chain or send a transaction you signed, use any Elysium endpoint: the public one, or a node of your own.
Readings
Section titled “Readings”GET /api/readings?market=<market> lists every relayed round posted to the market’s feed, newest first. A market is
named by its address or its /m/ slug; n takes 1 to 500 rounds (100 when left out), and before pages back to the
rounds numbered below it. The answer names the market, its relayed feed (feed), whether it relays a stock token or
copies a Chainlink feed (path: stock or chainlink), the Solana account it relays (source) and its decimals,
then the rounds in readings. Each round carries:
- its number in the feed (
round), and the answer exactly as signed (answer), with the feed’s decimals, and the price it gives (price: a stock’s as its share price at the multiplier in force now); - the time its price was observed (
observed_at), and its reference (ref): the Jupiter slot of a stock reading, or the Chainlink round id of a copied round; - its signed flags (
flags): 1 for the first stock reading after a closure, 2 for a step; - the account that posted it, the price signers whose signatures the post carried, and the transaction that posted it
(
poster,signers,txandlog_index), with the block and the time it landed (block,posted_at).
Relayed rounds are signed by Sagitta’s price signers, the keys on the signer set’s list (see Relayed prices). To check a stock reading, compare it with Jupiter’s price for its slot; to check a copied round, read the Chainlink round its reference names on Solana.
A wallet’s portfolio
Section titled “A wallet’s portfolio”GET /api/portfolio?wallet=0x… answers the wallet’s book in one call.
positions: every open holding, every market and side, older epochs included, each with itsepoch, whether it is the side’scurrentone, itstoken,shares(base units),converted(in current-epoch shares),value_hype(at the board’s NAV, before the 4% fee),worth_hype(what a cash-out pays) andcost_hype(the basis still held).pending: its tickets still waiting, each withamount(a mint’s HYPE, a redemption’s shares) andmatured.hypeandowed: the wallet’s HYPE and what each market owes it, read live in one batch;nullwhen the API could not read the chain.atandblock: how far the indexer has read. Holdings and tickets may trail the chain by a few seconds.totals:positions_hype,pending_hype,owed_hype,equity_hypeandequity_usd.
Each call counts against the caller’s per-IP budget for chain reads (see Limits), and an answer is kept for a few seconds.
Link previews
Section titled “Link previews”A link to sagitta.broker unfurls into its own card on X, Telegram, Discord and Slack. Their crawlers run no JavaScript, so each page carries its preview in the page itself, the same for every visitor: its title, description and canonical URL, and the Open Graph and X tags with a large image.
- A market (
/m/…) shows its price, its 24 h chart and both pots, from/api/pageand/api/og. It says what the market trades: a stock by its plain ticker and its company, labelled Stock (TSLA, Tesla); any other feed by its pair (SOL/USD). - A wallet (
/p/0x…) shows its open sides and what they are worth at pot NAV. A wallet with nothing on its book shows a card saying so. - Every other page carries its own title and line with the site card.
A preview’s URL keeps only the parameters that change the page: ref (who shared it), side and s.
A market’s card is drawn again whenever its state moves, and its image URL carries a tag of that state (&v=…), so a
tagged card can be cached for a day. If the API can’t answer in time, the page still carries the site card, served by
the site itself, and a card that can’t be drawn answers as the site card, uncached. Each page of these docs has a card
of its own, with its title and the section it sits in.
Limits
Section titled “Limits”Every call is counted before the API does any work for it, against one of three budgets. Each budget counts calls in a fixed 60-second window that starts with the caller’s first call in it.
| Budget | Who | Calls per 60 seconds |
|---|---|---|
| Without a key | Every other caller, counted per IP address (an IPv6 address by its /48) | 2 |
| With a key | A free API key sent with the call, counted per key wherever the calls come from | 30 |
| The site | sagitta.broker’s own pages, with a site token | 300 |
The site’s budget is sized for the pages themselves: the busiest makes about 60 calls a minute, so a tab can also move
through several pages in a minute, and people sharing one address (an office, a mobile network) are not turned away.
Only the site’s own pages can use it. A page gets its site token from POST /api/session after an invisible
Cloudflare Turnstile check, and the token works only from the IP address that asked for it. Programs use a key: it
costs one wallet signature, and API keys covers the two calls, how to pass it
(Authorization: Bearer <key> or X-Api-Key), rotating it and revoking it. A key that was revoked, replaced or never
issued gets 401 with the reason; it never falls back to the budget without a key.
What the answers say
Section titled “What the answers say”Answers that are made for one caller and never cached, such as a transaction to sign and every error, carry three headers, which a browser on another site may read:
| Header | Meaning |
|---|---|
RateLimit-Limit |
The calls your budget allows per window |
RateLimit-Remaining |
How many are left in this window |
RateLimit-Reset |
Seconds until the window starts over |
RateLimit-Policy restates the budget as 2;w=60. Answers that may be served from a shared cache (the board, the feed
and most reads) leave them out, since a cached copy would show someone else’s count; those calls are counted all the
same. A call over the budget gets 429 with Retry-After (seconds) and a short body naming the budget and where to
get a key:
{ "error": "rate limited: 2 calls per 60 seconds for each IP address without an API key. A free key raises that to 30: https://docs.sagitta.broker/agents/#api-keys", "tier": "external", "limit": 2, "window_s": 60, "retry_after_s": 41, "keys": "https://docs.sagitta.broker/agents/#api-keys"}tier is external without a key, key with one, and site for the site’s pages. Wait the Retry-After seconds,
then call again. A few endpoints also keep a budget of their own inside these, counted in the work each call may cause:
GET /api/portfolio, and the trading API’s ?who= and every POST /api/arena read the chain for one caller and cost
more than one unit. When one of those runs out the answer is also 429 with Retry-After, with the body
{ "error": "slow down" }.
Never counted
Section titled “Never counted”/health;- the reference itself,
GET /api, and its document,GET /api?spec=1(any other query on/apiis redirected to one of these two); - the link-preview routes
/api/ogand/api/page, so a link shared anywhere always gets its card; - the browser’s own CORS preflights (
OPTIONS).
The key endpoints are counted, always on the budget without a key, from the caller’s IP address.
The keeper, the indexer and the link-preview cards run inside the API’s own process and read its data directly, so none of them uses these budgets.
Caching
Section titled “Caching”Each read carries its own Cache-Control, a few seconds for most (the reference lists them). /api/winners lists the
newest 1,000 wins; its counts, boards and races cover all of them.
Programs
Section titled “Programs”The budget without a key suits a program that checks in now and then; one that watches the markets needs a free
key. Agents covers the trading API and the two command-line clients, sagitta.mjs
and nash.mjs.
The command-line clients use the API for market lists, balances and upkeep, and nothing else. They read the chain
through an RPC of their own, trust only the Sagitta Registry pinned when they were built, and build and check every
transaction themselves, so an API that answers wrongly can mislead what they show but never what they sign. A program
of your own can do the same with the SDK, or take its transactions from POST /api/arena and check them
before signing.