> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testnet.dev.adipredictstreet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RFQ maker API

> Signed quotes for market makers: request frames, quote submit, cancel, errors (RND-1845).

For market maker desks that answer requests for quote (RFQ) with signed quotes.

> [!NOTE]
>
> 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`](https://docs.testnet.dev.adipredictstreet.com/api-reference/websocket/events). 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

| Item | Value |
| - | - |
| Base path | `/api/v1/partner/rfq` |
| Auth | `X-Api-Key` header. A user session (JWT) and a self-service user key are refused. |
| Scope | `rfq:quote`, on both routes. Missing scope: 403 `api_key_scope_missing`. |
| Acting wallet | The key's own wallet. A multi-wallet key names it in the `X-User-Wallet` header on every call. |
| Maker check | Submit only: the acting wallet must be a market maker of your partner, else 403 `rfq_maker_required`. |
| Other submit gates | Platform freeze: 503 `platform_frozen`. RFQ paused: 503 `rfq_frozen`. A paused or restricted wallet: 403 `user_paused` (403 `rg_freeze` under a responsible-gambling freeze). A blocked, banned or closed wallet: refused at authentication (multi-wallet key: 403 `account_unavailable`; single-wallet key: a 401 with the account code, for example `account_closed` or `wallet_banned`). |

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.

| Bucket | Submit | Cancel |
| - | - | - |
| per maker wallet | 20 per second | 20 per second |
| per partner | 100 per second | 100 per second |
| per IP address | 3000 per minute | 3000 per minute |

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.

```json theme={null}
{ "id": 1, "cmd": "subscribe", "params": { "subscriptions": [ { "channel": "rfq_requests", "ids": ["*"] } ] } }
```

`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:

```json theme={null}
{
  "type": "rfq_request",
  "id": "rfq_example_0001",
  "data": {
    "requestId": "rfq_example_0001",
    "marketSymbol": "EXAMPLE-MARKET-1",
    "outcomeIndex": 0,
    "sizeBucket": "100",
    "sizeBucketRemainder": null,
    "requesterTag": "a1b2c3d4e5f6",
    "auctionEndsAt": "2026-12-01T10:00:05.000Z",
    "tick": "0.01",
    "feeRateBps": 100
  },
  "serverTs": 1796119200000,
  "sid": 1,
  "channel": "rfq_requests"
}
```

| Field | Meaning |
| - | - |
| `requestId` | Id of the request. Also the frame `id`. Dedupe by it: delivery is best effort, and a request can arrive more than once. |
| `marketSymbol`, `outcomeIndex` | The market and the outcome the customer asks about. |
| `sizeBucket` | Upper bound, in shares, of the size bucket to quote. The `bucket` of your leg is this exact text. |
| `sizeBucketRemainder` | Upper bound of a second bucket you may also quote, or `null`. It can equal `sizeBucket`; then one pair answers both. |
| `requesterTag` | A pseudonymous tag of the customer. No wallet, side, size or price is sent. |
| `auctionEndsAt` | End of the quote window, UTC. Quotes are accepted strictly before it. |
| `tick` | Price tick of the market. Your prices must be on this grid. |
| `feeRateBps` | The taker fee your signed order must carry. |

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`

```json theme={null}
{
  "requestId": "rfq_example_0001",
  "quotes": [
    {
      "side": "BUY",
      "bucket": "100",
      "signedOrder": {
        "salt": "52380971016118275996816926100147232695190102592230152000854381202490288162102",
        "maker": "<your vault address>",
        "signer": "<your acting wallet>",
        "taker": "0x0000000000000000000000000000000000000000",
        "tokenId": "<outcome token id>",
        "makerAmount": "47000000",
        "takerAmount": "100000000",
        "expiration": "1796205600",
        "feeRateBps": 100,
        "side": "BUY",
        "signatureType": 1,
        "signature": "0x<130 hex characters>"
      }
    },
    {
      "side": "SELL",
      "bucket": "100",
      "signedOrder": {
        "salt": "52380971016118275996816926100147232695190102592230152000854381202490288162102",
        "maker": "<your vault address>",
        "signer": "<your acting wallet>",
        "taker": "0x0000000000000000000000000000000000000000",
        "tokenId": "<outcome token id>",
        "makerAmount": "100000000",
        "takerAmount": "50000000",
        "expiration": "1796205600",
        "feeRateBps": 100,
        "side": "SELL",
        "signatureType": 1,
        "signature": "0x<130 hex characters>"
      }
    }
  ]
}
```

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](#errors)). 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](#what-happens-to-a-quote)) and the other still `received`.

```json theme={null}
{
  "requestId": "rfq_example_0001",
  "quotes": [
    { "quoteId": "rfq-quote-0f3a9c1e5b7d2a4c6e8b0d1f3a5c7e92", "bucket": "100", "side": "BUY", "status": "received" },
    { "quoteId": "rfq-quote-9d8c7b6a5f4e3d2c1b0a99887766554a", "bucket": "100", "side": "SELL", "status": "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`

```json theme={null}
{ "requestId": "rfq_example_0001" }
```

Answer, 200:

```json theme={null}
{ "requestId": "rfq_example_0001", "cancelled": ["rfq-quote-0f3a9c1e5b7d2a4c6e8b0d1f3a5c7e92", "rfq-quote-9d8c7b6a5f4e3d2c1b0a99887766554a"] }
```

* 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](#submitting-quotes)).
* 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](https://docs.testnet.dev.adipredictstreet.com/concepts/trading/cancelling.md).

## Limits and times

| Item | Value | Source |
| - | - | - |
| Legs per submit | 1 to 4 | fixed |
| Submits per maker per request | 16 | fixed |
| `requestId` length | up to 58 characters | fixed |
| Longest order expiry | 7 days from now | fixed |
| Submit window | strictly before `auctionEndsAt` | the frame |
| Auction length | up to 60 s | configurable; read `auctionEndsAt` |
| Customer countdown | 10 s to 60 s, hold is 1 s longer | configurable |
| Minimum order lifetime, spread cap, size buckets | set by PredictStreet | configurable; ask for the current values |
| Rate limits | [details](#access) | configurable defaults |
| Re-send of the same submit or cancel | answered while the request is live and for a short time after it ends (not after the customer cancels it) | fixed |

## 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:

| HTTP | Code | Retry | Meaning |
| - | - | - | - |
| 400 | `invalid_request` | no, fix the body | The body has a wrong shape, a missing key or an unknown key. `error.details.fields` lists them. (A malformed quote id in the cancel path is 404 `rfq_quote_not_found`.) |
| 401 | `auth_required`, `api_key_*`, `api_key_user_wallet_required`, `api_key_user_wallet_invalid` | no | No key, a bad key, or a multi-wallet key without a valid `X-User-Wallet`. |
| 403 | `api_key_required`, `api_key_required_not_jwt`, `partner_key_required` | no | A user session or a self-service key was used. |
| 403 | `api_key_scope_missing` | no | The key has no `rfq:quote`. |
| 403 | `account_unavailable` | no | The wallet is not bound to your partner (and, on the submit, is blocked, banned or closed). |
| 429 | `rate_limited` | yes, after `retryAfterSec` | A rate bucket is empty. |
| 503 | `account_check_error` | yes | The wallet check could not be read. |
| 503 | `rfq_route_unavailable` | yes | The request could not be looked up. Nothing was sent. |
| 502 | `rfq_contract_fault` | no, contact PredictStreet | An internal fault. |

Submit only:

| HTTP | Code | Retry | Meaning |
| - | - | - | - |
| 401 | `account_closed`, `wallet_banned` and other account codes | no | Single-wallet key on a closed, banned or blocked wallet. |
| 404 | (unknown route) | later | RFQ is not switched on. On a re-send this says nothing about the first attempt ([details](#submitting-quotes)). |
| 403 | `rfq_maker_required` | no | The acting wallet is not a market maker of your partner. |
| 403 | `user_paused`, `rg_freeze` | no | The wallet is paused or restricted. |
| 503 | `platform_frozen` | yes, after `retryAfterSec` | Trading is frozen. |
| 503 | `rfq_frozen` | yes, after `retryAfterSec` (60) | RFQ is paused. This submit was not recorded; quote cancels still work. On a re-send this says nothing about the first attempt ([details](#submitting-quotes)). |
| 404 | `rfq_request_not_found` | no | The request is unknown or has ended. On a first send nothing was recorded. On a re-send it only means the request has ended: an earlier attempt may have been selected and filled, so check your trade records. |
| 400 | `rfq_quote_invalid` | no | The quote was refused as malformed. Nothing was recorded. |
| 429 | `rfq_maker_submissions_full` | no | The 16-submit limit for this request is reached. |
| 503 | `rfq_disabled` | no | Quotes are not accepted right now. On a re-send this says nothing about the first attempt ([details](#submitting-quotes)). |
| 503 | `rfq_quote_not_sent` | yes | Nothing was received or recorded, for example because the market-maker check could not be read. Send the quote again. |
| 503 | `rfq_quote_unknown` | yes, send the same body, with a growing pause, until a definite answer ([details](#submitting-quotes)) | The quote may have been received. |

Cancel only:

| HTTP | Code | Retry | Meaning |
| - | - | - | - |
| 404 | `rfq_request_not_found` | no | The request is unknown or has ended. |
| 404 | `rfq_quote_not_found` | no | No such quote of this wallet on this request. |
| 409 | `rfq_quote_not_cancellable` | no | The quote is no longer live: the auction ended, it is selected, or a later submit of yours replaced it. |
| 503 | `rfq_quote_cancel_not_sent` | yes | Nothing was changed. Send it again. |
| 503 | `rfq_quote_cancel_unknown` | yes | The cancel may have been applied. Send it again. |

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.

| Reason | Meaning | Retry |
| - | - | - |
| `malformed_uint` | A numeric field is not canonical decimal text. | Fix |
| `salt_unbound` | `salt` is not the salt of this `requestId`. | Fix |
| `signer_not_maker` | `signer` is not the acting wallet. | Fix |
| `maker_not_vault` | `maker` is not your vault for this market. | Fix |
| `taker_not_open` | `taker` is not the zero address. | Fix |
| `fee_mismatch` | `feeRateBps` differs from the frame. | Fix |
| `token_mismatch` | `tokenId` is not the outcome token. | Fix |
| `side_mismatch` | The order `side` does not match the leg. | Fix |
| `signature_type` | `signatureType` is not 1. | Fix |
| `signature_invalid` | The signature does not verify for `signer`. | Fix |
| `expiry_short` | `expiration` is below the minimum lifetime. | Fix |
| `expiration_too_far` | `expiration` is more than 7 days away. | Fix |
| `amounts_inconsistent` | The share amount is not the bucket size. | Fix |
| `price_off_grid` | The amounts give no price on the market tick. | Fix |
| `price_out_of_range` | The price is not between 0 and 1. | Fix |
| `quote_crossed` | The bid is above the ask. | Fix |
| `spread_over_cap` | The spread is above the cap. | Fix |
| `one_sided` | The bucket has no BUY or no SELL leg. | Fix |
| `duplicate_side` | A second leg of the same side in one bucket. | Fix |
| `bucket_not_offered` | The bucket is neither `sizeBucket` nor `sizeBucketRemainder`. | Fix |
| `request_not_collecting` | The window is closed (or the request ended). Also seen on a re-send of a late submit. | No |
| `maker_excluded`, `maker_not_active`, `maker_suspended` | The wallet may not quote this request, is not an active market maker, or is suspended. | No, contact PredictStreet |
| `maker_no_vault`, `maker_vault_in_emergency`, `maker_vault_factory_retired` | Your vault for this market is missing, in emergency withdrawal, or from a retired factory. | No, contact PredictStreet |
| `hash_reused` | This signed order is already stored for another quote (a live, replaced, cancelled or earlier rejected one). | Sign every leg anew (new `expiration` or amounts) |
| `exists_not_live` | The stored quote with these ids is not live. | Sign a new order |
| `id_conflict` | The pair does not match what is stored under its ids. | Sign a new order |
| `superseded` | A later submit of yours already joined the auction. | No |
| `replaced`, `cancelled`, `not_live` | Seen on a re-send: the quote was replaced, cancelled, or never joined. | No |
| `insufficient`, `withdrawal_pending`, `jit_buy_unsupported`, `market_not_open`, `vault_in_emergency`, `hold_expiry_too_long`, `hold_already_ended`, `hold_unarmed`, `rfq_disabled`, `placement_refused`, `signature_invalid`, `token_mismatch`, `maker_suspended` | Seen on a re-send, on a leg that was first answered `received`: the quote was selected but the hold was refused ([details](#what-happens-to-a-quote)). In a first answer, `signature_invalid`, `token_mismatch` and `maker_suspended` have the meaning of their rows above. The most common is `insufficient`: fund the vault. | No for this request |
| `order_hash_malformed`, `price_amounts_mismatch` | Internal checks: nothing in your body causes them. | No, contact PredictStreet |
| `other` | A reason this document does not list. | Contact PredictStreet |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.