https://prices.rekt.trading. There is no other address. Use TLS everywhere.
The stream is wss://prices.rekt.trading/v1/stream.
Only the instructions that read a price need a quote: settle, stamp_book, set_take_profit and
prove_price. An open, an add and a close request carry none.
A quote is 80 bytes signed by several keys. The Knockout program verifies the signatures on chain,
and refuses a quote that fails any check on Quotes and freshness. Nothing the service
returns outside the signed bytes is authoritative.
The loop
- Once, at start-up.
GET /v1/feeds. Take the feeds of the markets you trade. A market’s feed ismarket.feeds[0]; it equals thefeed_idlisted for that symbol. Pin it. - When you are about to act.
POST /v1/quote, or hold a stream open and keep the latest frame. - Judge it.
benchmarkQuoteViewturns a quote into the view the gates judge:priceGatesapplies the program’s own admission rule before you spend a fee. - Send it.
submitBenchmarkQuotedplaces the quote’s ed25519 instruction immediately before yours in the same transaction and sends it. See Settling a position. - On a refusal, read the status.
409and429are retryable afterretry_after_ms.400and422are not: fix the request.
payload (the 80 signed bytes, hex), signatures, ed25519_instruction_data
(the complete instruction, ready to place before yours) and decoded, a mirror for reading. Decide on
the bytes, not on decoded.
Rules that matter
- A quote ages out. The program judges its age at execution, against
market.maxOracleAgeSlots. Fetch a new quote for every attempt, with a newidempotency_key. Reuse a key only for an immediate retry after a transport failure. - A window quote is the first quote at or after a slot. Ask for it with
min_slotandpayload_version: 2. Every caller who asks for the same slot gets the same bytes. - A failure is never a price. A refusal has a status, a reason and a retry hint.
- A market with trading hours says so inside the signature. A closed session signs no price. See Markets.
- Call the service from a server, not from a browser. It sends no CORS headers, so a browser
cannot call it. Keep a token out of URLs. If you have one, send it as
Authorization: Bearer <token>.
Limits
Public use needs no sign-up and is rate limited per client address, so clients behind one address share a limit. A limited request gets429 with retry_after_ms and a Retry-After header. A
limit says nothing about whether a feed is healthy.
- Use the stream rather than polling for the latest price.
- Fetch
GET /v1/feedsat start-up, not per request. - Back off with jitter on
429and503, and honourretry_after_ms. - Keep one stream connection per process.
