{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Polymarket RFQ Quoter Gateway",
    "version": "1.0.0",
    "description": "WebSocket gateway for combinatorial RFQ quoters (market makers). Receive broadcast RFQ requests, submit and cancel signed quotes, respond to last-look confirmation requests, track execution updates, and receive confirmed trade broadcasts.\n\nConventions:\n- All `*_e6` fields are six-decimal fixed-point values encoded as strings.\n- All timestamps are Unix milliseconds (integer).\n- The gateway sends WebSocket ping control frames every 30 seconds with payload `rfq`; clients must respond with pong control frames. Connections are closed after 2 minutes without an inbound message or pong."
  },
  "servers": {
    "production": {
      "host": "combos-rfq-gateway-quoter.polymarket.com",
      "pathname": "/ws/rfq",
      "protocol": "wss",
      "description": "Production quoter gateway WebSocket server"
    }
  },
  "channels": {
    "quoter": {
      "address": "/ws/rfq",
      "title": "Quoter Gateway",
      "description": "Authenticated quoter channel. Send the `auth` message as the first message within 30 seconds. The gateway broadcasts active RFQ requests, accepts signed quotes and cancellations, issues last-look confirmation requests, streams execution updates, and sends confirmed trade broadcasts.",
      "messages": {
        "auth": {
          "$ref": "#/components/messages/auth"
        },
        "authResponse": {
          "$ref": "#/components/messages/authResponse"
        },
        "rfqRequest": {
          "$ref": "#/components/messages/rfqRequest"
        },
        "rfqQuote": {
          "$ref": "#/components/messages/rfqQuote"
        },
        "ackRfqQuote": {
          "$ref": "#/components/messages/ackRfqQuote"
        },
        "rfqQuoteCancel": {
          "$ref": "#/components/messages/rfqQuoteCancel"
        },
        "ackRfqQuoteCancel": {
          "$ref": "#/components/messages/ackRfqQuoteCancel"
        },
        "rfqConfirmationRequest": {
          "$ref": "#/components/messages/rfqConfirmationRequest"
        },
        "rfqConfirmationResponse": {
          "$ref": "#/components/messages/rfqConfirmationResponse"
        },
        "ackRfqConfirmationResponse": {
          "$ref": "#/components/messages/ackRfqConfirmationResponse"
        },
        "rfqExecutionUpdate": {
          "$ref": "#/components/messages/rfqExecutionUpdate"
        },
        "rfqTrade": {
          "$ref": "#/components/messages/rfqTrade"
        },
        "rfqError": {
          "$ref": "#/components/messages/rfqError"
        }
      }
    }
  },
  "operations": {
    "authenticate": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Authenticate",
      "summary": "Authenticate the connection (send as the first message)",
      "description": "Authenticate with CLOB API credentials and the signer/maker identity used for RFQ orders. Must be the first message, sent within 30 seconds of connecting.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/auth"
        }
      ]
    },
    "authResult": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Auth Result",
      "summary": "Gateway response to the auth message",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/authResponse"
        }
      ]
    },
    "receiveRfqRequest": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "RFQ Request",
      "summary": "Broadcast of an active RFQ request to quote",
      "description": "Broadcasts an active request with derived combo position IDs and a submission deadline. Quoters must respond before `submission_deadline`.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqRequest"
        }
      ]
    },
    "submitQuote": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Submit Quote",
      "summary": "Submit a signed maker quote before the submission deadline",
      "description": "Submit a signed Exchange v3 order. Do not include `quote_id` (server-generated) or top-level `signer_address`/`maker_address`/`signature_type` (applied from the authenticated session).",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqQuote"
        }
      ]
    },
    "acknowledgeQuote": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Quote Ack",
      "summary": "Returns the server-generated quote ID",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/ackRfqQuote"
        }
      ]
    },
    "cancelQuote": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Cancel Quote",
      "summary": "Cancel an active maker quote before it is selected",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqQuoteCancel"
        }
      ]
    },
    "acknowledgeQuoteCancel": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Quote Cancel Ack",
      "summary": "Confirms quote cancellation",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/ackRfqQuoteCancel"
        }
      ]
    },
    "receiveConfirmationRequest": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Confirmation Request",
      "summary": "Last-look confirmation request for a selected quote",
      "description": "Sent when the selected quote's maker has last look enabled. Respond before `confirm_by`.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqConfirmationRequest"
        }
      ]
    },
    "respondConfirmation": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Confirmation Response",
      "summary": "Confirm or decline a selected quote during last look",
      "description": "Respond before `confirm_by`. Do not include top-level `signer_address`, `maker_address`, or `signature_type`; identity is applied from the authenticated session.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqConfirmationResponse"
        }
      ]
    },
    "acknowledgeConfirmation": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Confirmation Ack",
      "summary": "Confirms the maker's last-look response",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/ackRfqConfirmationResponse"
        }
      ]
    },
    "receiveExecutionUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Execution Update",
      "summary": "Execution progress for selected makers",
      "description": "Reports execution progress. `CONFIRMED` and `FAILED` are terminal.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqExecutionUpdate"
        }
      ]
    },
    "receiveTradeBroadcast": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Trade Broadcast",
      "summary": "Confirmed Combo RFQ trade broadcast",
      "description": "Broadcasts confirmed Combo RFQ trades to authenticated quoter sessions. Delivery is best-effort, and consumers should deduplicate by `rfq_id`.",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqTrade"
        }
      ]
    },
    "receiveError": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/quoter"
      },
      "title": "Error",
      "summary": "Sent when a command fails validation or cannot be applied",
      "messages": [
        {
          "$ref": "#/channels/quoter/messages/rfqError"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "auth": {
        "name": "Auth",
        "title": "Auth",
        "summary": "Authenticate the connection",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/AuthMessage"
        },
        "examples": [
          {
            "name": "Authenticate",
            "payload": {
              "type": "auth",
              "auth": {
                "apiKey": "YOUR_API_KEY",
                "secret": "YOUR_API_SECRET",
                "passphrase": "YOUR_API_PASSPHRASE"
              },
              "identity": {
                "signer_address": "0xYourSigner",
                "maker_address": "0xYourQuoterWallet",
                "signature_type": 0
              }
            }
          }
        ]
      },
      "authResponse": {
        "name": "AuthResponse",
        "title": "Auth Response",
        "summary": "Gateway response to the auth message",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/AuthResponse"
        },
        "examples": [
          {
            "name": "Success",
            "payload": {
              "type": "auth",
              "success": true,
              "address": "0xAuthenticatedAddress"
            }
          },
          {
            "name": "Failure",
            "payload": {
              "type": "auth",
              "success": false,
              "error": "unauthenticated"
            }
          }
        ]
      },
      "rfqRequest": {
        "name": "RfqRequest",
        "title": "RFQ_REQUEST",
        "summary": "Broadcast of an active RFQ request",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqRequest"
        },
        "examples": [
          {
            "name": "Active request",
            "payload": {
              "type": "RFQ_REQUEST",
              "rfq_id": "rfq_<id>",
              "requestor_public_id": "req_<public_id>",
              "leg_position_ids": [
                "<leg_position_id_1>",
                "<leg_position_id_2>"
              ],
              "condition_id": "0x<condition_id>",
              "yes_position_id": "<yes_position_id>",
              "no_position_id": "<no_position_id>",
              "direction": "BUY",
              "side": "YES",
              "requested_size": {
                "unit": "notional",
                "value_e6": "1000000"
              },
              "submission_deadline": 1780575184000
            }
          }
        ]
      },
      "rfqQuote": {
        "name": "RfqQuote",
        "title": "RFQ_QUOTE",
        "summary": "Submit a signed maker quote",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqQuote"
        },
        "examples": [
          {
            "name": "Submit quote",
            "payload": {
              "type": "RFQ_QUOTE",
              "rfq_id": "rfq_<id>",
              "price_e6": "450000",
              "size_e6": "1000000",
              "signed_order": {
                "salt": "<order_salt>",
                "maker": "0xYourQuoterWallet",
                "signer": "0xYourSigner",
                "tokenId": "<yes_or_no_position_id>",
                "makerAmount": "<amount_to_pay>",
                "takerAmount": "<taker_amount>",
                "side": 0,
                "signatureType": 0,
                "timestamp": "<unix_seconds>",
                "metadata": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "builder": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "signature": "0x..."
              }
            }
          }
        ]
      },
      "ackRfqQuote": {
        "name": "AckRfqQuote",
        "title": "ACK_RFQ_QUOTE",
        "summary": "Returns the server-generated quote ID",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/AckRfqQuote"
        },
        "examples": [
          {
            "name": "Quote accepted",
            "payload": {
              "type": "ACK_RFQ_QUOTE",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>"
            }
          }
        ]
      },
      "rfqQuoteCancel": {
        "name": "RfqQuoteCancel",
        "title": "RFQ_QUOTE_CANCEL",
        "summary": "Cancel an active maker quote",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqQuoteCancel"
        },
        "examples": [
          {
            "name": "Cancel quote",
            "payload": {
              "type": "RFQ_QUOTE_CANCEL",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>",
              "signer_address": "0xYourSigner",
              "maker_address": "0xYourQuoterWallet"
            }
          }
        ]
      },
      "ackRfqQuoteCancel": {
        "name": "AckRfqQuoteCancel",
        "title": "ACK_RFQ_QUOTE_CANCEL",
        "summary": "Confirms quote cancellation",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/AckRfqQuoteCancel"
        },
        "examples": [
          {
            "name": "Cancel confirmed",
            "payload": {
              "type": "ACK_RFQ_QUOTE_CANCEL",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>"
            }
          }
        ]
      },
      "rfqConfirmationRequest": {
        "name": "RfqConfirmationRequest",
        "title": "RFQ_CONFIRMATION_REQUEST",
        "summary": "Last-look confirmation request for a selected quote",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqConfirmationRequest"
        },
        "examples": [
          {
            "name": "Confirmation request",
            "payload": {
              "type": "RFQ_CONFIRMATION_REQUEST",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>",
              "signer_address": "0xYourSigner",
              "maker_address": "0xYourQuoterWallet",
              "signature_type": 0,
              "leg_position_ids": [
                "<leg_position_id_1>",
                "<leg_position_id_2>"
              ],
              "condition_id": "0x<condition_id>",
              "yes_position_id": "<yes_position_id>",
              "no_position_id": "<no_position_id>",
              "direction": "BUY",
              "side": "YES",
              "fill_size_e6": "1000000",
              "price_e6": "450000",
              "confirm_by": 1780575184000
            }
          }
        ]
      },
      "rfqConfirmationResponse": {
        "name": "RfqConfirmationResponse",
        "title": "RFQ_CONFIRMATION_RESPONSE",
        "summary": "Confirm or decline a selected quote",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqConfirmationResponse"
        },
        "examples": [
          {
            "name": "Confirm",
            "payload": {
              "type": "RFQ_CONFIRMATION_RESPONSE",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>",
              "decision": "CONFIRM"
            }
          }
        ]
      },
      "ackRfqConfirmationResponse": {
        "name": "AckRfqConfirmationResponse",
        "title": "ACK_RFQ_CONFIRMATION_RESPONSE",
        "summary": "Confirms the maker's last-look response",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/AckRfqConfirmationResponse"
        },
        "examples": [
          {
            "name": "Confirmation ack",
            "payload": {
              "type": "ACK_RFQ_CONFIRMATION_RESPONSE",
              "rfq_id": "rfq_<id>",
              "quote_id": "quote_<id>",
              "decision": "CONFIRM"
            }
          }
        ]
      },
      "rfqExecutionUpdate": {
        "name": "RfqExecutionUpdate",
        "title": "RFQ_EXECUTION_UPDATE",
        "summary": "Execution progress for selected makers",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqExecutionUpdate"
        },
        "examples": [
          {
            "name": "Mined",
            "payload": {
              "type": "RFQ_EXECUTION_UPDATE",
              "rfq_id": "rfq_<id>",
              "status": "MINED",
              "tx_hash": "0x<transaction_hash>"
            }
          }
        ]
      },
      "rfqTrade": {
        "name": "RfqTrade",
        "title": "RFQ_TRADE",
        "summary": "Confirmed Combo RFQ trade broadcast",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqTrade"
        },
        "examples": [
          {
            "name": "Confirmed trade",
            "payload": {
              "type": "RFQ_TRADE",
              "rfq_id": "rfq_<id>",
              "requester_id": "req_<public_id>",
              "condition_id": "0x<condition_id>",
              "leg_position_ids": [
                "<leg_position_id_1>",
                "<leg_position_id_2>"
              ],
              "direction": "BUY",
              "side": "YES",
              "price_e6": "125000",
              "size_e6": "800000",
              "executed_at": 1780854786039
            }
          }
        ]
      },
      "rfqError": {
        "name": "RfqError",
        "title": "RFQ_ERROR",
        "summary": "Sent when a command fails validation or cannot be applied",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/RfqError"
        },
        "examples": [
          {
            "name": "Competition window closed",
            "payload": {
              "type": "RFQ_ERROR",
              "request_type": "RFQ_QUOTE",
              "rfq_id": "rfq_<id>",
              "code": "SUBMISSION_WINDOW_CLOSED",
              "error": "submission window closed"
            }
          }
        ]
      }
    },
    "schemas": {
      "SignatureType": {
        "type": "integer",
        "description": "CLOB signature type: 0 EOA, 1 POLY_PROXY, 2 GNOSIS_SAFE, 3 POLY_1271.",
        "enum": [
          0,
          1,
          2,
          3
        ]
      },
      "Direction": {
        "type": "string",
        "description": "Requester trade direction.",
        "enum": [
          "BUY",
          "SELL"
        ]
      },
      "Side": {
        "type": "string",
        "description": "Combinatorial position side. Currently only YES is supported.",
        "enum": [
          "YES",
          "NO"
        ]
      },
      "RequestedSize": {
        "type": "object",
        "description": "Requested RFQ size and unit.",
        "required": [
          "unit",
          "value_e6"
        ],
        "properties": {
          "unit": {
            "type": "string",
            "description": "`notional` for requester BUY RFQs and `shares` for requester SELL RFQs.",
            "enum": [
              "notional",
              "shares"
            ]
          },
          "value_e6": {
            "type": "string",
            "description": "Six-decimal fixed-point value encoded as a string."
          }
        }
      },
      "ExchangeV3Order": {
        "type": "object",
        "description": "Signed Exchange v3 order.",
        "required": [
          "salt",
          "maker",
          "signer",
          "tokenId",
          "makerAmount",
          "takerAmount",
          "side",
          "signatureType",
          "timestamp",
          "signature"
        ],
        "properties": {
          "salt": {
            "type": "string",
            "description": "Order salt (uint256 as a decimal string)."
          },
          "maker": {
            "type": "string",
            "description": "Wallet that funds the order."
          },
          "signer": {
            "type": "string",
            "description": "Address that signs the order."
          },
          "tokenId": {
            "type": "string",
            "description": "YES or NO combo position ID (uint256 as a decimal string)."
          },
          "makerAmount": {
            "type": "string",
            "description": "Amount the maker pays, in six-decimal base units."
          },
          "takerAmount": {
            "type": "string",
            "description": "Amount the maker receives, in six-decimal base units."
          },
          "side": {
            "type": "integer",
            "description": "Order side — 0 BUY, 1 SELL.",
            "enum": [
              0,
              1
            ]
          },
          "signatureType": {
            "$ref": "#/components/schemas/SignatureType"
          },
          "timestamp": {
            "type": "string",
            "description": "Order timestamp in Unix seconds (as a string)."
          },
          "metadata": {
            "type": "string",
            "description": "32-byte hex field; defaults to the zero value."
          },
          "builder": {
            "type": "string",
            "description": "32-byte hex field; defaults to the zero value."
          },
          "signature": {
            "type": "string",
            "description": "EIP-712 signature over the order."
          }
        }
      },
      "AuthMessage": {
        "type": "object",
        "description": "Authentication message. Must be the first message after connecting.",
        "required": [
          "type",
          "auth",
          "identity"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "auth"
          },
          "auth": {
            "type": "object",
            "description": "CLOB API credentials.",
            "required": [
              "apiKey",
              "secret",
              "passphrase"
            ],
            "properties": {
              "apiKey": {
                "type": "string",
                "description": "CLOB API key."
              },
              "secret": {
                "type": "string",
                "description": "CLOB API secret."
              },
              "passphrase": {
                "type": "string",
                "description": "CLOB API passphrase."
              }
            }
          },
          "identity": {
            "type": "object",
            "description": "Signer/maker identity used for RFQ orders.",
            "required": [
              "signer_address",
              "maker_address",
              "signature_type"
            ],
            "properties": {
              "signer_address": {
                "type": "string",
                "description": "Address that signs orders."
              },
              "maker_address": {
                "type": "string",
                "description": "Wallet that funds orders."
              },
              "signature_type": {
                "$ref": "#/components/schemas/SignatureType"
              }
            }
          }
        }
      },
      "AuthResponse": {
        "type": "object",
        "description": "Gateway response to the auth message.",
        "required": [
          "type",
          "success"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "auth"
          },
          "success": {
            "type": "boolean"
          },
          "address": {
            "type": "string",
            "description": "Authenticated address, present on success."
          },
          "error": {
            "type": "string",
            "description": "Error detail, present on failure."
          }
        }
      },
      "RfqRequest": {
        "type": "object",
        "description": "Broadcast of an active RFQ request.",
        "required": [
          "type",
          "rfq_id",
          "requestor_public_id",
          "leg_position_ids",
          "condition_id",
          "yes_position_id",
          "no_position_id",
          "direction",
          "side",
          "requested_size",
          "submission_deadline"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_REQUEST"
          },
          "rfq_id": {
            "type": "string",
            "description": "Server-assigned RFQ ID."
          },
          "requestor_public_id": {
            "type": "string",
            "description": "Opaque public ID for the RFQ source."
          },
          "leg_position_ids": {
            "type": "array",
            "description": "Canonical leg position IDs in the combo.",
            "items": {
              "type": "string"
            }
          },
          "condition_id": {
            "type": "string",
            "description": "Derived combinatorial condition ID."
          },
          "yes_position_id": {
            "type": "string",
            "description": "Derived YES combo position ID."
          },
          "no_position_id": {
            "type": "string",
            "description": "Derived NO combo position ID."
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "requested_size": {
            "$ref": "#/components/schemas/RequestedSize"
          },
          "submission_deadline": {
            "type": "integer",
            "format": "int64",
            "description": "Quote submission deadline in Unix milliseconds."
          }
        }
      },
      "RfqQuote": {
        "type": "object",
        "description": "Submit a signed maker quote before the submission deadline.",
        "required": [
          "type",
          "rfq_id",
          "price_e6",
          "size_e6",
          "signed_order"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_QUOTE"
          },
          "rfq_id": {
            "type": "string",
            "description": "RFQ ID from RFQ_REQUEST."
          },
          "price_e6": {
            "type": "string",
            "description": "Quote price in six-decimal fixed-point units."
          },
          "size_e6": {
            "type": "string",
            "description": "Fillable share count in six-decimal fixed-point units."
          },
          "signed_order": {
            "$ref": "#/components/schemas/ExchangeV3Order"
          }
        }
      },
      "AckRfqQuote": {
        "type": "object",
        "description": "Returns the server-generated quote ID.",
        "required": [
          "type",
          "rfq_id",
          "quote_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "ACK_RFQ_QUOTE"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string",
            "description": "Server-generated quote ID."
          }
        }
      },
      "RfqQuoteCancel": {
        "type": "object",
        "description": "Cancel an active maker quote before it is selected.",
        "required": [
          "type",
          "rfq_id",
          "quote_id",
          "signer_address",
          "maker_address"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_QUOTE_CANCEL"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string",
            "description": "Server-generated quote ID."
          },
          "signer_address": {
            "type": "string",
            "description": "Must match the authenticated signer_address."
          },
          "maker_address": {
            "type": "string",
            "description": "Must match the authenticated maker_address."
          }
        }
      },
      "AckRfqQuoteCancel": {
        "type": "object",
        "description": "Confirms quote cancellation.",
        "required": [
          "type",
          "rfq_id",
          "quote_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "ACK_RFQ_QUOTE_CANCEL"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string"
          }
        }
      },
      "RfqConfirmationRequest": {
        "type": "object",
        "description": "Last-look confirmation request for a selected quote.",
        "required": [
          "type",
          "rfq_id",
          "quote_id",
          "signer_address",
          "maker_address",
          "signature_type",
          "leg_position_ids",
          "condition_id",
          "yes_position_id",
          "no_position_id",
          "direction",
          "side",
          "fill_size_e6",
          "price_e6",
          "confirm_by"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_CONFIRMATION_REQUEST"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string",
            "description": "Selected quote ID."
          },
          "signer_address": {
            "type": "string"
          },
          "maker_address": {
            "type": "string"
          },
          "signature_type": {
            "$ref": "#/components/schemas/SignatureType"
          },
          "leg_position_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "condition_id": {
            "type": "string"
          },
          "yes_position_id": {
            "type": "string"
          },
          "no_position_id": {
            "type": "string"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "fill_size_e6": {
            "type": "string",
            "description": "Selected fill size in six-decimal fixed-point units."
          },
          "price_e6": {
            "type": "string",
            "description": "Selected quote price in six-decimal fixed-point units."
          },
          "confirm_by": {
            "type": "integer",
            "format": "int64",
            "description": "Confirmation deadline in Unix milliseconds."
          }
        }
      },
      "RfqConfirmationResponse": {
        "type": "object",
        "description": "Confirm or decline a selected quote. Identity is applied from the authenticated session.",
        "required": [
          "type",
          "rfq_id",
          "quote_id",
          "decision"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_CONFIRMATION_RESPONSE"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string",
            "description": "Selected quote ID."
          },
          "decision": {
            "type": "string",
            "enum": [
              "CONFIRM",
              "DECLINE"
            ]
          }
        }
      },
      "AckRfqConfirmationResponse": {
        "type": "object",
        "description": "Confirms the maker's last-look response.",
        "required": [
          "type",
          "rfq_id",
          "quote_id",
          "decision"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "ACK_RFQ_CONFIRMATION_RESPONSE"
          },
          "rfq_id": {
            "type": "string"
          },
          "quote_id": {
            "type": "string"
          },
          "decision": {
            "type": "string",
            "enum": [
              "CONFIRM",
              "DECLINE"
            ]
          }
        }
      },
      "RfqExecutionUpdate": {
        "type": "object",
        "description": "Reports execution progress for selected makers. CONFIRMED and FAILED are terminal.",
        "required": [
          "type",
          "rfq_id",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_EXECUTION_UPDATE"
          },
          "rfq_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "MATCHED",
              "MINED",
              "RETRYING",
              "CONFIRMED",
              "FAILED"
            ]
          },
          "tx_hash": {
            "type": "string",
            "description": "Transaction hash, when available."
          }
        }
      },
      "RfqTrade": {
        "type": "object",
        "description": "Confirmed Combo RFQ trade broadcast. Excludes maker identity and per-maker fill allocations.",
        "required": [
          "type",
          "rfq_id",
          "requester_id",
          "condition_id",
          "leg_position_ids",
          "direction",
          "side",
          "price_e6",
          "size_e6",
          "executed_at"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_TRADE"
          },
          "rfq_id": {
            "type": "string",
            "description": "RFQ ID for deduplication and reconciliation."
          },
          "requester_id": {
            "type": "string",
            "description": "Opaque public ID for the RFQ source."
          },
          "condition_id": {
            "type": "string",
            "description": "Derived combinatorial condition ID."
          },
          "leg_position_ids": {
            "type": "array",
            "description": "Canonical leg position IDs in the combo.",
            "items": {
              "type": "string"
            }
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "price_e6": {
            "type": "string",
            "description": "Accepted blended price in six-decimal fixed-point units."
          },
          "size_e6": {
            "type": "string",
            "description": "Matched Combo share size in six-decimal fixed-point units."
          },
          "executed_at": {
            "type": "integer",
            "format": "int64",
            "description": "Execution timestamp in Unix milliseconds."
          }
        }
      },
      "RfqError": {
        "type": "object",
        "description": "Sent when a command fails validation or cannot be applied.",
        "required": [
          "type",
          "code",
          "error"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "RFQ_ERROR"
          },
          "request_type": {
            "type": "string",
            "description": "Inbound command that failed, when parsed."
          },
          "rfq_id": {
            "type": "string",
            "description": "RFQ ID, when present on the failed command."
          },
          "quote_id": {
            "type": "string",
            "description": "Quote ID, when present on the failed command."
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code. New codes may be introduced over time; treat unrecognized codes as command-level failures.",
            "enum": [
              "ADDRESS_MISMATCH",
              "ALLOWANCE_VALIDATION_FAILED",
              "BALANCE_VALIDATION_FAILED",
              "CONTRADICTORY_LEGS",
              "EXPIRED_RFQ",
              "INVALID_ACCEPTANCE",
              "INVALID_CONFIRMATION",
              "INVALID_EXECUTION_RESULT",
              "INVALID_IDENTITY",
              "INVALID_MESSAGE",
              "INVALID_QUOTE",
              "INVALID_RFQ",
              "INVALID_RFQ_STATE",
              "INVALID_ROLE",
              "LEG_METADATA_UNAVAILABLE",
              "MAKER_ALREADY_RESPONDED",
              "MAKER_NOT_REQUIRED",
              "MAKER_QUOTE_LIMITED",
              "PRE_EXECUTION_BALANCE_RESERVATION_FAILED",
              "QUOTE_MISMATCH",
              "QUOTE_UNAVAILABLE",
              "RATE_LIMITED",
              "REQUEST_FAILED",
              "SERVICE_UNAVAILABLE",
              "SUBMISSION_WINDOW_CLOSED",
              "TRADE_SUBMISSION_FAILED",
              "UNAUTHENTICATED",
              "UNAUTHORIZED_ROLE",
              "UNKNOWN_RFQ"
            ]
          },
          "error": {
            "type": "string",
            "description": "Human-readable error detail for logging and debugging."
          }
        }
      }
    }
  }
}