Skip to main content
For market maker desks that answer requests for quote (RFQ) with signed quotes.
RFQ is off by default and is not switched on everywhere. While it is off, the submit route answers as an unknown route (404); the cancel route stays open. The REST routes need the scope rfq:quote, which PredictStreet grants to a key on request; the WebSocket channel needs no scope. The WebSocket channel and the submit need the acting wallet to be registered as a market maker of your partner.

What RFQ is for a maker

  • A customer asks for a price on a market outcome and a size. The request is broadcast to makers over the WebSocket channel rfq_requests. It does not say whether the customer buys or sells.
  • You answer with a two-way quote per size bucket: one signed BUY order (bid) and one signed SELL order (ask), over the REST route below.
  • When the auction window ends, the best total for the customer wins, the order book included; a tie goes to the combination that uses the book (its remainder can still be filled by a quote). Between quotes, ties go to the earliest receipt, then to the lower quote id. The customer’s price limit can remove quotes, so a quote is not sure to win.
  • Only the winner is held: its funds are reserved for a short countdown, and the customer may take it. Other quotes reserve nothing.
  • A quote is firm up to the bucket size you signed for.

Access

Rate limits, per route (the cancel has its own, so re-quoting at your limit does not block a cancel). The values are defaults and PredictStreet can change them. Over the limit: 429 rate_limited with retryAfterSec and a Retry-After header. Retry after that delay.

Receiving a request

Open /ws/user with the same X-Api-Key and X-User-Wallet headers, then subscribe. Only an API key whose acting wallet is a market maker of its partner may subscribe; any other session gets forbidden_channel in rejected. The channel needs no scope.
ids (at least one): * for every request, cat:sport, cat:crypto or cat:other_non_sport for one category, or a market symbol. Within one subscription a request is sent once, even if several of its ids match; two subscriptions each get the frame. Each request arrives as one frame:
Frames are live only: nothing is replayed after a reconnect. A request whose auctionEndsAt has passed is not forwarded. If the socket is closed with code 4409 (reason market_access_changed or api_key_changed), reconnect and subscribe again. If your wallet is no longer a market maker, the new subscribe is refused forbidden_channel: do not loop.

Submitting quotes

POST /api/v1/partner/rfq/quotes
Rules for the body:
  • requestId: from the frame, up to 58 characters of A-Z a-z 0-9 _ -.
  • quotes: 1 to 4 legs. Each leg has side (BUY or SELL), bucket (the frame’s sizeBucket or sizeBucketRemainder, as text) and signedOrder. Unknown keys are refused (400 invalid_request).
  • Quote both sides of a bucket. The BUY leg is your bid and the SELL leg your ask. A bucket with only one side is rejected one_sided. Within one bucket only the first BUY and the first SELL are used; a further leg of the same side is rejected duplicate_side. With two buckets you send up to 4 legs.
  • signedOrder has exactly these 12 keys. Numbers in salt, tokenId, makerAmount, takerAmount and expiration are decimal text without leading zeros.
    • salt: the decimal value of keccak256 of the UTF-8 bytes of requestId. It ties the order to one request.
    • maker: your vault address for the market (EIP-55 or all-lower-case). signer: your acting wallet. taker: the zero address.
    • tokenId: the outcome token of marketSymbol and outcomeIndex. Both legs use it. Read it from GET /api/markets/{marketSymbol}: outcomes[].tokenId for the outcomeIndex. Call it and GET /api/platform/contracts with your API key (and X-User-Wallet for a multi-wallet key): a market that is not open to everyone yet is hidden from an anonymous read.
    • side: BUY for the bid, SELL for the ask, equal to the leg side.
    • Shares: the share amount of both orders is the bucket upper bound times 1,000,000 (takerAmount of a BUY, makerAmount of a SELL). The other amount is the price times shares times 1,000,000: rounded up for a BUY, down for a SELL. The price is read from your amounts and must lie on the market tick and strictly between 0 and 1. A price that does not reproduce exactly is rejected price_off_grid; wrong share amounts are rejected amounts_inconsistent. The example above is bid 0.47 and ask 0.50 for a 100 share bucket.
    • feeRateBps: equal to the frame’s feeRateBps.
    • signatureType: 1. signature: 65 bytes as 0x plus 130 hex characters, an EIP-712 signature of the order, by signer. Its v is 27 or 28 (1b / 1c) and its s is in the lower half; any other form (v 0 or 1, a high s, a 64-byte signature) is rejected signature_invalid. Domain: name PredictStreet, version 1, chainId the chain id from GET /api/platform/contracts, verifyingContract the market’s exchangeAddress from GET /api/markets/{marketSymbol} (when it is null, use ctfExchange or ctfExchangeNegRisk from /api/platform/contracts, by negRiskEligible). Type Order, in this order: uint256 salt, address maker, address signer, address taker, uint256 tokenId, uint256 makerAmount, uint256 takerAmount, uint256 expiration, uint256 feeRateBps, uint8 side, uint8 signatureType, with side 0 for BUY and 1 for SELL.
    • expiration: Unix seconds. It must be at least the current time plus a minimum lifetime that PredictStreet sets (it is not in the frame), and at most 7 days from now. A signed order stays valid until expiration, so keep it only a little above the minimum lifetime, for example 30 s more: the check runs when the submit arrives, so an order signed for exactly the minimum is rejected expiry_short.
  • The bid must not be above the ask, and the spread (ask minus bid) must not exceed a cap that PredictStreet sets. A zero spread is valid.
Response, always 200 when the submit was processed. Each leg is received or rejected; a rejected leg stays in the 200 and carries a reason (details). Before the auction ends the BUY and the SELL of one bucket are always received or rejected together, with the same reason. Only an extra leg (a second BUY or SELL of the same bucket) is answered apart: duplicate_side, or the reason that refuses the whole submit or the whole bucket. After the auction any answer (a re-send, or a late first answer) can show one leg rejected (its hold was refused, see details) and the other still received.
Keep the quoteId: the cancel route on this page needs it. Re-submit replaces. Every leg of every new submit needs a newly signed order (a new expiration or new amounts), also a leg that was rejected, replaced or cancelled before: a bucket whose order is already stored for another quote is rejected hash_reused. A new submit of yours on the same request replaces all your earlier live quotes on it, in every bucket, once at least one pair of the new submit is received. So if one bucket is received and another is rejected, your earlier quote in the rejected bucket is replaced too. Only a submit whose pairs are all rejected leaves your earlier quotes live. At most 16 different submits per maker per request; past that: 429 rfq_maker_submissions_full. Re-send after an unknown outcome. If you get 503 rfq_quote_unknown, or no answer at all, send the same body again, with a growing pause between tries, until you get a definite answer. Do not stop at auctionEndsAt: a submit that was recorded is still answered for a short time after the request ends (not after the customer cancels it), and one that was not is then answered request_not_collecting or 404. The same body is answered with the recorded answer; a changed body is a new submit. A re-sent answer shows each quote as it stands now: still received while it is live, selected, lost or filled (the outcome of the auction is not told here), or rejected with replaced, cancelled, the reason it was refused when held, or not_live. A refusal of a re-send says nothing about the first attempt: a 404 (rfq_request_not_found, or the unknown route when RFQ was switched off in between) or a 503 rfq_disabled or rfq_frozen can come after the first attempt was received, selected and filled. Check your own trade records for fills of this request; do not read it as “nothing happened”.

Cancelling a quote

POST /api/v1/partner/rfq/quotes/{quoteId}/cancel
Answer, 200:
  • A quote is one half of a pair (the BUY and the SELL of one bucket). A cancel ends both, so cancelled can list a quote id you did not name.
  • Cancel a quote that was received, using the quote id from the answer. A leg rejected in the first answer never joined the auction: cancelling it is 404 rfq_quote_not_found. Cancelling a quote that is already cancelled answers 200 again.
  • This cancel works only while the request is still collecting quotes and the quote is live. After that, or when a later submit of yours replaced the quote: 409 rfq_quote_not_cancellable.
  • The cancel is a way out. It does not need RFQ to be switched on, it is not stopped by the platform freeze, by an RFQ pause or by a paused wallet, and a blocked, banned or closed maker can still cancel. It does not check that the wallet is still a market maker. The key still needs the rfq:quote scope and the wallet must be bound to your partner.
  • If you get 503 rfq_quote_cancel_unknown, send the same cancel again. A 404 rfq_request_not_found on that re-send means the request has ended. An ended request fills no quote that was not selected, but a quote that was selected may already be filled: check your trade records.

What happens to a quote

  • Live (received): your quote competes until auctionEndsAt. Nothing is reserved.
  • Selected: at the end of the window the best quote is chosen. Funds are then reserved on your side the way a resting limit order reserves them: a BUY reserves collateral, a SELL reserves outcome tokens. The reservation covers the held size only, the part of the quote that the customer’s request needs, never more than the signed order. If your funds do not cover it (or the vault, market, signature or wallet fails a check at that moment), the quote is dropped and the next best is tried. Nothing on these two routes reports this live; a re-send of the same submit shows the refusal (details).
  • Held: the hold lasts as long as the customer’s countdown plus 1 second. The countdown length is set by PredictStreet (between 10 and 60 seconds).
  • Taken: if the customer confirms before the countdown ends and the confirm succeeds, the quote is filled against your signed order and the reservation is used.
  • Lapses or released: if the customer lets the countdown run out, cancels the request, or the request fails, the hold ends and the reservation is released. A quote that was not selected is simply lost, with nothing to release.
  • The cancel route on this page refuses a selected quote (409 rfq_quote_not_cancellable). While it is held and no confirm has taken it, it is an order of your wallet: POST /api/orders/cancel, cancel-batch and cancel-all can end it, so a cancel-all also releases it. Once a confirm has taken it, POST /api/orders/cancel answers 409 rfq_order_taken. See Cancelling orders.

Limits and times

Errors

Every error has the form { "status": <http>, "error": { "code", "message", "retryable"?, "retryAfterSec"?, "trace_id"?, "details"? } }. error.details.requestId carries the request id when the code has one. Quote error.trace_id to support when it is there. Branch on code, and on retryable where it is present. Both routes: Submit only: Cancel only: Rejection reasons on a leg of a 200. A rejected leg is not live. “Fix” means correct the order and submit again; the other rows say when a new submit can help.