Exit without the site
Your side tokens sit in your own wallet, and the market program pays out to whoever holds them. You never need sagitta.broker, its API or any Sagitta server to leave a market.
What you need
Section titled “What you need”- The wallet that holds the side tokens, with a little SOL for fees and the ticket’s refundable deposit.
- Any Solana RPC endpoint, for example the public one at
https://api.mainnet-beta.solana.com. - The market’s address: from its page on sagitta.broker, from Solscan (a side token’s mint authority is its market),
or from core’s
MarketRegisteredevents (see Programs). - A client for the market program: the SDK from Sagitta’s public repository, or any client built from the program’s IDL, which is published on chain with the program.
The steps
Section titled “The steps”- Commit a cash-out on the market program:
commit_redeem(side, shares, recipient), with side0for UP or1for DOWN andsharesin the token’s base units (6 decimals). Your tokens are burned from your own token account in the same instruction, so no approval is needed. Tokens of an earlier epoch convert first, withconvert(side, fromEpoch, toEpoch, amount): the last convert, to the current epoch, goes in the same transaction as the cash-out, and tokens many epochs behind take converts of their own before it, each to an epoch you name, as far as one transaction holds. - Wait for your reading, the first reading after your commit. It needs new data:
- On a stock token or a relayed memecoin market, the reading of a slot after your commit, which Sagitta’s price
signers post once the blocks it is computed from are final. Every posted reading is listed by
GET /api/readings, and is on chain in the market’s reading ring either way. - On a pool history market, two observations the pool stores after your commit.
- On a Chainlink market, a new round, observed more than a minute after your commit, copied into the market with
capture_round, which anyone can send.
- On a stock token or a relayed memecoin market, the reading of a slot after your commit, which Sagitta’s price
signers post once the blocks it is computed from are final. Every posted reading is listed by
- Settle it with
execute, which anyone can call, and you can earn its bounty yourself if you have a market wallet. Until the data exists, an execute changes nothing and the ticket keeps waiting. - Take the SOL:
deliverpays it to the ticket’s recipient when that leaves the account above its rent minimum, and returns the ticket’s deposit to you; orclaim, signed by the recipient, takes it into any account it names.
With the SDK
Section titled “With the SDK”import { address, createSolanaRpc } from "@solana/kit";import { DEPLOYMENT } from "@sagitta/config";import { programsOf, readMarket, tx } from "@sagitta/sdk";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com"); // or any Solana RPCconst market = address("…"); // the market: a side token's mint authority names itconst p = programsOf(DEPLOYMENT); // core and the market program; an older market uses its own version's
// 1. Commit the cash-out: your tokens of the side's current epoch are burned into a ticketconst view = await readMarket(rpc, p, market);const t = await tx.commitRedeem(p, view, { trader: signer, side: 0, shares }); // side 0 is UP, 1 is DOWN// t holds the instructions and an unsigned message with your wallet as fee payer: sign it, then submit it
// 2. Once its reading is in, settle it (any wallet may) and take delivery// tx.execute(p, view, { … }), then tx.deliver(p, view, ticket, { payer: signer }) or tx.claim(…)Why this always works
Section titled “Why this always works”- The programs are immutable: their upgrade authority is removed once deployed, so no one can change a deployed market’s code.
- No admin path can touch the SOL in pots or tickets.
- Cashing out, executing, delivering and claiming never read core’s settings, so no pause, sunset or setting can block them. A pause stops new buys only.
- Once an old version is sunset (a separate timelock operation from shipping its replacement), its buys stop and its pots stay redeemable forever.
- If a market’s price source goes silent, the market freezes once its oldest waiting ticket has had no reading for 7 days, and every holder cashes out at the frozen price (see Refunds).
See Security for everything admins can and can’t do.