{
  "asyncapi": "3.0.0",
  "info": {
    "title": "covr maker RFQ gateway",
    "version": "0.1.1+bb3e1c9e",
    "description": "WebSocket protocol between covr's RFQ gateway and a market-making desk. This document describes the gateway: `receive` operations are messages a desk sends, `send` operations are messages the gateway pushes.\n\nTiming: bids are collected for 3000 ms after an RFQ is created; the best price is awarded; an award lasts at most 3000 ms and never past the hard deadline, 6000 ms after creation. A quote's validUntil may be at most 60 s after the gateway starts admitting it.\n\nPractice mode: until covr lists a desk on its markets, its bid intents are verified and then refused with \"Bid intent verified but not entered: this market does not list this maker yet\".\n\nProse reference, with ranking, award passing and every refusal: https://docs.covr.markets/#reference.gateway.overview",
    "x-covr-source": {
      "commit": "bb3e1c9e5dd2e7794eddc9b985b95756d2957a32",
      "sdkVersion": "0.1.1"
    }
  },
  "defaultContentType": "application/json",
  "servers": {
    "production": {
      "host": "{host}",
      "protocol": "wss",
      "description": "covr gives each desk the host. All routes need the bearer token covr issues.",
      "variables": {
        "host": {
          "description": "Provided by covr."
        }
      },
      "security": [
        {
          "$ref": "#/components/securitySchemes/bearer"
        }
      ]
    }
  },
  "channels": {
    "maker": {
      "address": "/maker",
      "title": "Command socket",
      "description": "JSON-RPC 2.0 over text frames. Every refusal is a JSON-RPC error with code -32602. For bid_intent, quote and award_decline the JSON-RPC id must be the RFQ id. Keep one request per RFQ in flight.",
      "messages": {
        "bidIntent": {
          "name": "bid_intent",
          "title": "Bid intent",
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "jsonrpc",
              "id",
              "method",
              "params"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "maxLength": 128,
                "description": "The RFQ id."
              },
              "method": {
                "const": "bid_intent"
              },
              "params": {
                "$ref": "#/components/schemas/BidIntent"
              }
            }
          },
          "examples": [
            {
              "name": "golden vector",
              "payload": {
                "jsonrpc": "2.0",
                "id": "3f2b8c1e-5d4a-4e7b-9c2d-1a2b3c4d5e6f",
                "method": "bid_intent",
                "params": {
                  "auctionId": "3f2b8c1e-5d4a-4e7b-9c2d-1a2b3c4d5e6f",
                  "kind": "open",
                  "market": "3ZyjE1mByRWXfGhKX1qt1LmqVueWc78KgTo8ik9fiXxH",
                  "position": null,
                  "wallet": "4aDwH64QdwwvrkVRxJbTPj78YRsaqV7Ru1HipKuCJ8HA",
                  "assetAddress": "0x43127405c3191a0b63a5f3d845f616ffea348c68",
                  "chainId": 2000000001,
                  "expiry": 1792742400,
                  "isPut": false,
                  "isTakerBuy": false,
                  "quantity": "500000000000000000",
                  "strike": "17000000000",
                  "usd": "0x5ce3bf3a31af18be40ba30f721101b4341690186",
                  "collateralAsset": "0x43127405c3191a0b63a5f3d845f616ffea348c68",
                  "maker": "0x7B99e6A7407Fe0058119F4f13494C0b9cec35738",
                  "price": "2400000000000000000",
                  "validUntil": 1792490466,
                  "signature": "0xcf12abfcee5e71e15375685b4b4f52bd74e31b540e8eb6ca9c806a7ea391ee38433d33b1b7c81b2c9964096272a9ee680b9766b801caa81b694240020a57460a1b"
                }
              }
            }
          ]
        },
        "bidIntentAccepted": {
          "name": "bid_intent result",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string"
              },
              "result": {
                "const": "BID_ACCEPTED"
              }
            }
          }
        },
        "quote": {
          "name": "quote",
          "title": "Executable quote (award holder only)",
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "jsonrpc",
              "id",
              "method",
              "params"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "maxLength": 128,
                "description": "The RFQ id."
              },
              "method": {
                "const": "quote"
              },
              "params": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "intentSignature",
                  "quote"
                ],
                "properties": {
                  "intentSignature": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{130}$",
                    "description": "The signature of your awarded bid intent."
                  },
                  "quote": {
                    "$ref": "#/components/schemas/QuoteV2"
                  }
                }
              }
            }
          },
          "examples": [
            {
              "name": "golden vector",
              "payload": {
                "jsonrpc": "2.0",
                "id": "3f2b8c1e-5d4a-4e7b-9c2d-1a2b3c4d5e6f",
                "method": "quote",
                "params": {
                  "intentSignature": "0xcf12abfcee5e71e15375685b4b4f52bd74e31b540e8eb6ca9c806a7ea391ee38433d33b1b7c81b2c9964096272a9ee680b9766b801caa81b694240020a57460a1b",
                  "quote": {
                    "auctionId": "3f2b8c1e-5d4a-4e7b-9c2d-1a2b3c4d5e6f",
                    "writer": "4aDwH64QdwwvrkVRxJbTPj78YRsaqV7Ru1HipKuCJ8HA",
                    "assetAddress": "0x43127405c3191a0b63a5f3d845f616ffea348c68",
                    "chainId": 2000000001,
                    "isPut": false,
                    "strike": "17000000000",
                    "expiry": 1792742400,
                    "maker": "0x7B99e6A7407Fe0058119F4f13494C0b9cec35738",
                    "nonce": "1001",
                    "price": "2400000000000000000",
                    "quantity": "500000000000000000",
                    "isTakerBuy": false,
                    "validUntil": 1792490463,
                    "usd": "0x5ce3bf3a31af18be40ba30f721101b4341690186",
                    "collateralAsset": "0x43127405c3191a0b63a5f3d845f616ffea348c68",
                    "signature": "0xe8e829e6106ac480abd418bcc039cd959a48a65a6c55f716209562564a3f66a4250bcb3a4e39c7e00135ec1bc0c306ede8422b30e5470a55f4af81a72f8b4a691c"
                  }
                }
              }
            }
          ]
        },
        "quoteAccepted": {
          "name": "quote result",
          "description": "The gateway admitted the quote and shows it to the customer. Not a fill.",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string"
              },
              "result": {
                "const": "OK"
              }
            }
          }
        },
        "awardDecline": {
          "name": "award_decline",
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "jsonrpc",
              "id",
              "method",
              "params"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "maxLength": 128,
                "description": "The RFQ id."
              },
              "method": {
                "const": "award_decline"
              },
              "params": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "intentSignature"
                ],
                "properties": {
                  "intentSignature": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{130}$"
                  }
                }
              }
            }
          }
        },
        "awardDeclined": {
          "name": "award_decline result",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string"
              },
              "result": {
                "const": "DECLINED"
              }
            }
          }
        },
        "rfqNote": {
          "name": "rfq_note",
          "description": "Display-only reason the customer sees when you will not price an RFQ. Only from a maker the market lists.",
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "jsonrpc",
              "id",
              "method",
              "params"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "maxLength": 128,
                "description": "Any string; the RFQ goes in params.rfqId."
              },
              "method": {
                "const": "rfq_note"
              },
              "params": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "reason",
                  "rfqId"
                ],
                "properties": {
                  "rfqId": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "warming_up",
                      "fully_booked",
                      "wallet_limit",
                      "too_large",
                      "not_priced"
                    ]
                  }
                }
              }
            }
          }
        },
        "rfqNoted": {
          "name": "rfq_note result",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string"
              },
              "result": {
                "const": "NOTED"
              }
            }
          }
        },
        "award": {
          "name": "award",
          "title": "Award (pushed)",
          "description": "You won. Answer with quote or award_decline on this same socket before awardUntil. Do not answer with a JSON-RPC response.",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "method",
              "params"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "description": "The RFQ id."
              },
              "method": {
                "const": "award"
              },
              "params": {
                "$ref": "#/components/schemas/AwardParams"
              }
            }
          }
        },
        "error": {
          "name": "error",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "error"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error": {
                "type": "object",
                "required": [
                  "code",
                  "message"
                ],
                "properties": {
                  "code": {
                    "const": -32602
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "bindings": {
        "ws": {
          "method": "GET",
          "headers": {
            "type": "object",
            "required": [
              "Authorization"
            ],
            "properties": {
              "Authorization": {
                "type": "string",
                "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr] [A-Za-z0-9._~+/-]{16,256}=*$",
                "maxLength": 300
              }
            }
          },
          "bindingVersion": "0.1.0"
        }
      },
      "x-close-codes": [
        {
          "code": 4401,
          "reason": "Unauthorized",
          "when": "No token, or a token that is not registered. Sent before the socket is subscribed or read."
        },
        {
          "code": 4403,
          "reason": "Asset not allowed",
          "when": "A feed for an asset your token does not allow."
        },
        {
          "code": 4429,
          "reason": "Too many connections",
          "when": "Your maker already holds 16 sockets on the desk endpoint."
        },
        {
          "code": 4429,
          "reason": "Too many frames",
          "when": "The frame budget ran out (100 at once, then 20 per second; messages and pings count)."
        },
        {
          "code": 1009,
          "reason": "",
          "when": "A frame larger than 16384 bytes (the WebSocket library's message-too-big close)."
        }
      ]
    },
    "rfqFeed": {
      "address": "/rfqs/{assetAlias}",
      "title": "RFQ feed (read-only)",
      "description": "One message per new customer RFQ for this collateral. It carries no market and no customer wallet: read GET /api/rfqs/{id}. Anything you send on a feed is refused.",
      "parameters": {
        "assetAlias": {
          "description": "Collateral alias: lowercase 0x + 40 hex, keccak256 of the 32-byte mint, last 20 bytes. Desks can open the JitoSOL call feed (0x43127405c3191a0b63a5f3d845f616ffea348c68).",
          "examples": [
            "0x43127405c3191a0b63a5f3d845f616ffea348c68"
          ]
        }
      },
      "messages": {
        "rfq": {
          "name": "rfq",
          "title": "RFQ (pushed)",
          "description": "Shaped like a JSON-RPC response, but you never sent a request. id is the RFQ id.",
          "payload": {
            "type": "object",
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "result": {
                "$ref": "#/components/schemas/RfqRequest"
              }
            }
          },
          "examples": [
            {
              "name": "golden vector request",
              "payload": {
                "jsonrpc": "2.0",
                "id": "3f2b8c1e-5d4a-4e7b-9c2d-1a2b3c4d5e6f",
                "result": {
                  "asset": "0x43127405c3191a0b63a5f3d845f616ffea348c68",
                  "assetName": "Ordinary token",
                  "chainId": 2000000001,
                  "expiry": 1792742400,
                  "isPut": false,
                  "isTakerBuy": false,
                  "quantity": "500000000000000000",
                  "strike": "17000000000",
                  "taker": "0x0000000000000000000000000000000000000000",
                  "usd": "0x5ce3bf3a31af18be40ba30f721101b4341690186",
                  "collateralAsset": "0x43127405c3191a0b63a5f3d845f616ffea348c68"
                }
              }
            }
          ]
        }
      },
      "bindings": {
        "ws": {
          "method": "GET",
          "headers": {
            "type": "object",
            "required": [
              "Authorization"
            ],
            "properties": {
              "Authorization": {
                "type": "string"
              }
            }
          },
          "bindingVersion": "0.1.0"
        }
      },
      "x-close-codes": [
        {
          "code": 4401,
          "reason": "Unauthorized",
          "when": "No token, or a token that is not registered. Sent before the socket is subscribed or read."
        },
        {
          "code": 4403,
          "reason": "Asset not allowed",
          "when": "A feed for an asset your token does not allow."
        },
        {
          "code": 4429,
          "reason": "Too many connections",
          "when": "Your maker already holds 16 sockets on the desk endpoint."
        },
        {
          "code": 4429,
          "reason": "Too many frames",
          "when": "The frame budget ran out (100 at once, then 20 per second; messages and pings count)."
        },
        {
          "code": 1009,
          "reason": "",
          "when": "A frame larger than 16384 bytes (the WebSocket library's message-too-big close)."
        }
      ]
    }
  },
  "operations": {
    "receiveBidIntent": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/maker"
      },
      "summary": "Desk sends one sealed bid per RFQ, before closesAt (3000 ms after creation).",
      "messages": [
        {
          "$ref": "#/channels/maker/messages/bidIntent"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/maker"
        },
        "messages": [
          {
            "$ref": "#/channels/maker/messages/bidIntentAccepted"
          },
          {
            "$ref": "#/channels/maker/messages/error"
          }
        ]
      }
    },
    "sendAward": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/maker"
      },
      "summary": "Gateway awards the best price to the socket that sent it.",
      "messages": [
        {
          "$ref": "#/channels/maker/messages/award"
        }
      ]
    },
    "receiveQuote": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/maker"
      },
      "summary": "Award holder sends its signed quote before awardUntil, on the awarded socket.",
      "messages": [
        {
          "$ref": "#/channels/maker/messages/quote"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/maker"
        },
        "messages": [
          {
            "$ref": "#/channels/maker/messages/quoteAccepted"
          },
          {
            "$ref": "#/channels/maker/messages/error"
          }
        ]
      }
    },
    "receiveAwardDecline": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/maker"
      },
      "summary": "Award holder passes the award to the next ranked bid.",
      "messages": [
        {
          "$ref": "#/channels/maker/messages/awardDecline"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/maker"
        },
        "messages": [
          {
            "$ref": "#/channels/maker/messages/awardDeclined"
          },
          {
            "$ref": "#/channels/maker/messages/error"
          }
        ]
      }
    },
    "receiveRfqNote": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/maker"
      },
      "summary": "Optional customer-facing reason for not pricing.",
      "messages": [
        {
          "$ref": "#/channels/maker/messages/rfqNote"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/maker"
        },
        "messages": [
          {
            "$ref": "#/channels/maker/messages/rfqNoted"
          },
          {
            "$ref": "#/channels/maker/messages/error"
          }
        ]
      }
    },
    "sendRfq": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/rfqFeed"
      },
      "summary": "Gateway announces each new RFQ once. There is no replay.",
      "messages": [
        {
          "$ref": "#/channels/rfqFeed/messages/rfq"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "RfqRequest": {
        "description": "The RFQ request: the instrument terms the customer asked for.",
        "type": "object",
        "properties": {
          "asset": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "assetName": {
            "type": "string"
          },
          "chainId": {
            "type": "integer",
            "description": "Always 2000000001: a venue tag for EIP-712, not an EVM chain."
          },
          "expiry": {
            "type": "integer",
            "description": "Option expiry, unix seconds."
          },
          "isPut": {
            "type": "boolean"
          },
          "isTakerBuy": {
            "type": "boolean"
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Collateral in whole tokens scaled by 10^18."
          },
          "strike": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Strike in USD per whole token, scaled by 10^8."
          },
          "taker": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "usd": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "collateralAsset": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          }
        },
        "required": [
          "asset",
          "assetName",
          "chainId",
          "expiry",
          "isPut",
          "isTakerBuy",
          "quantity",
          "strike",
          "taker",
          "usd",
          "collateralAsset"
        ],
        "additionalProperties": false
      },
      "BidIntent": {
        "description": "Sealed bid. EIP-712 primary type BidIntent, signed in the market's domain.",
        "type": "object",
        "properties": {
          "auctionId": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "open",
              "position_sale",
              "early_close"
            ]
          },
          "market": {
            "type": "string",
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
            "description": "The MarketV3 account. Sign in its EIP-712 domain."
          },
          "position": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
          },
          "wallet": {
            "type": "string",
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
            "description": "The customer's Solana wallet, from the RFQ snapshot."
          },
          "assetAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "chainId": {
            "type": "integer",
            "description": "Always 2000000001: a venue tag for EIP-712, not an EVM chain."
          },
          "expiry": {
            "type": "integer",
            "description": "Option expiry, unix seconds."
          },
          "isPut": {
            "type": "boolean"
          },
          "isTakerBuy": {
            "type": "boolean"
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Collateral in whole tokens scaled by 10^18."
          },
          "strike": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Strike in USD per whole token, scaled by 10^8."
          },
          "usd": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "collateralAsset": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "maker": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Your registered quote key (secp256k1 address). Must be the maker your token is bound to."
          },
          "price": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Gross premium per one whole collateral token, in USDC scaled by 10^18. quantity x price / 10^30 must be a whole number of USDC atoms."
          },
          "validUntil": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "signature": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{130}$"
          }
        },
        "required": [
          "auctionId",
          "kind",
          "market",
          "position",
          "wallet",
          "assetAddress",
          "chainId",
          "expiry",
          "isPut",
          "isTakerBuy",
          "quantity",
          "strike",
          "usd",
          "collateralAsset",
          "maker",
          "price",
          "validUntil",
          "signature"
        ],
        "additionalProperties": false,
        "x-eip712": {
          "primaryType": "BidIntent",
          "fields": [
            {
              "name": "auctionId",
              "type": "bytes32"
            },
            {
              "name": "kind",
              "type": "uint8"
            },
            {
              "name": "market",
              "type": "bytes32"
            },
            {
              "name": "position",
              "type": "bytes32"
            },
            {
              "name": "wallet",
              "type": "bytes32"
            },
            {
              "name": "assetAddress",
              "type": "address"
            },
            {
              "name": "chainId",
              "type": "uint256"
            },
            {
              "name": "isPut",
              "type": "bool"
            },
            {
              "name": "strike",
              "type": "uint256"
            },
            {
              "name": "expiry",
              "type": "uint64"
            },
            {
              "name": "maker",
              "type": "address"
            },
            {
              "name": "price",
              "type": "uint256"
            },
            {
              "name": "quantity",
              "type": "uint256"
            },
            {
              "name": "isTakerBuy",
              "type": "bool"
            },
            {
              "name": "validUntil",
              "type": "uint64"
            },
            {
              "name": "usd",
              "type": "address"
            },
            {
              "name": "collateralAsset",
              "type": "address"
            }
          ]
        }
      },
      "QuoteV2": {
        "description": "Executable quote. EIP-712 primary type QuoteV2, signed in the market's domain.",
        "type": "object",
        "properties": {
          "assetAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "chainId": {
            "type": "integer",
            "description": "Always 2000000001: a venue tag for EIP-712, not an EVM chain."
          },
          "expiry": {
            "type": "integer",
            "description": "Option expiry, unix seconds."
          },
          "isPut": {
            "type": "boolean"
          },
          "isTakerBuy": {
            "type": "boolean"
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Collateral in whole tokens scaled by 10^18."
          },
          "strike": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Strike in USD per whole token, scaled by 10^8."
          },
          "maker": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Your registered quote key (secp256k1 address). Must be the maker your token is bound to."
          },
          "nonce": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "u64 below 2^64 - 1. Names the one position this quote can open. Never reuse one."
          },
          "price": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Gross premium per one whole collateral token, in USDC scaled by 10^18. quantity x price / 10^30 must be a whole number of USDC atoms."
          },
          "validUntil": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "usd": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "collateralAsset": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "signature": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{130}$"
          },
          "auctionId": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "writer": {
            "type": "string",
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
            "description": "The customer's Solana wallet, from the RFQ snapshot."
          }
        },
        "required": [
          "assetAddress",
          "chainId",
          "expiry",
          "isPut",
          "isTakerBuy",
          "quantity",
          "strike",
          "maker",
          "nonce",
          "price",
          "validUntil",
          "usd",
          "collateralAsset",
          "signature",
          "auctionId",
          "writer"
        ],
        "additionalProperties": false,
        "x-eip712": {
          "primaryType": "QuoteV2",
          "fields": [
            {
              "name": "auctionId",
              "type": "bytes32"
            },
            {
              "name": "writer",
              "type": "bytes32"
            },
            {
              "name": "assetAddress",
              "type": "address"
            },
            {
              "name": "chainId",
              "type": "uint256"
            },
            {
              "name": "isPut",
              "type": "bool"
            },
            {
              "name": "strike",
              "type": "uint256"
            },
            {
              "name": "expiry",
              "type": "uint64"
            },
            {
              "name": "maker",
              "type": "address"
            },
            {
              "name": "nonce",
              "type": "uint64"
            },
            {
              "name": "price",
              "type": "uint256"
            },
            {
              "name": "quantity",
              "type": "uint256"
            },
            {
              "name": "isTakerBuy",
              "type": "bool"
            },
            {
              "name": "validUntil",
              "type": "uint64"
            },
            {
              "name": "usd",
              "type": "address"
            },
            {
              "name": "collateralAsset",
              "type": "address"
            }
          ]
        }
      },
      "RfqSnapshot": {
        "description": "One RFQ as GET /api/rfqs/{id} returns it to a desk. A desk sees the quote fields only for its own admitted quote. Unknown fields may be added: ignore them.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "open",
              "position_sale",
              "early_close"
            ]
          },
          "position": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
          },
          "status": {
            "type": "string",
            "examples": [
              "collecting",
              "finalizing",
              "quoted",
              "no_quote",
              "expired"
            ]
          },
          "market": {
            "type": "string",
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
            "description": "The MarketV3 account. Sign in its EIP-712 domain."
          },
          "preparationFamily": {
            "type": "string",
            "examples": [
              "ordinary-v3",
              "restricted-v3"
            ]
          },
          "closesAt": {
            "type": "integer",
            "description": "Bid collection ends, unix ms."
          },
          "hardDeadline": {
            "type": "integer",
            "description": "No quote is admitted at or after this, unix ms."
          },
          "bidCount": {
            "type": "integer"
          },
          "wallet": {
            "type": "string",
            "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
            "description": "The customer's Solana wallet, from the RFQ snapshot."
          },
          "request": {
            "$ref": "#/components/schemas/RfqRequest"
          },
          "stockSelection": {},
          "quote": {
            "$ref": "#/components/schemas/QuoteV2"
          }
        },
        "required": [
          "id",
          "kind",
          "position",
          "status",
          "market",
          "closesAt",
          "hardDeadline",
          "wallet",
          "request"
        ],
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "PublicQuoteStatus": {
        "description": "Whether covr's own maker can quote customers right now. Says nothing about your desk.",
        "type": "object",
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "markets": {
            "type": "integer"
          },
          "priceAgeSec": {
            "type": [
              "integer",
              "null"
            ]
          },
          "checkedAt": {
            "type": "integer"
          }
        },
        "required": [
          "ready",
          "markets",
          "priceAgeSec",
          "checkedAt"
        ],
        "additionalProperties": false
      },
      "PublicHealth": {
        "description": "Liveness view of the quote status, for uptime monitors.",
        "type": "object",
        "properties": {
          "idle": {
            "const": true
          },
          "healthy": {
            "type": "boolean"
          },
          "notReadyForMs": {
            "type": "integer"
          },
          "ready": {
            "type": "boolean"
          },
          "markets": {
            "type": "integer"
          },
          "priceAgeSec": {
            "type": [
              "integer",
              "null"
            ]
          },
          "checkedAt": {
            "type": "integer"
          }
        },
        "required": [
          "healthy",
          "notReadyForMs",
          "ready",
          "markets",
          "priceAgeSec",
          "checkedAt"
        ],
        "additionalProperties": false
      },
      "AwardParams": {
        "type": "object",
        "properties": {
          "intent": {
            "$ref": "#/components/schemas/BidIntent"
          },
          "awardUntil": {
            "type": "integer",
            "description": "Your quote must be admitted before this, unix ms."
          },
          "hardDeadline": {
            "type": "integer",
            "description": "No quote is admitted at or after this, unix ms."
          }
        },
        "required": [
          "intent",
          "awardUntil",
          "hardDeadline"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Token issued by covr (prefix covr_mk_), bound to your quote key, Solana authority and allowed assets. Sent on every upgrade and HTTP request."
      }
    }
  },
  "x-limits": {
    "socketsPerMaker": 16,
    "frameBurst": 100,
    "framesPerSecond": 20,
    "maxFrameBytes": 16384,
    "unreadDataBytes": 1048576,
    "heartbeatIntervalMs": 30000,
    "jsonRpcIdMaxLength": 128,
    "rfqMemorySeconds": 120,
    "refusalHandshakesInProgress": 32,
    "collectMs": 3000,
    "awardMs": 3000,
    "hardDeadlineMs": 6000,
    "maxQuoteLifetimeSeconds": 60
  },
  "x-eip712-domain": {
    "fields": [
      "name",
      "version",
      "chainId",
      "verifyingContract"
    ],
    "base": {
      "name": "SOL Covered Calls",
      "version": "1",
      "chainId": 2000000001
    },
    "example": {
      "name": "SOL Covered Calls",
      "version": "1",
      "chainId": 2000000001,
      "verifyingContract": "0x21a8f3a5ea7cf85099905bcf8f065f1d148a80f3"
    },
    "note": "Each market has its own domain: the base fields plus a verifyingContract derived from the program (8ZpbTPnDECPTDGN5VHHKH5gfer6EUTnRHcFwfUAbkJDg), the market's own terms and covr's deployment id. Compute it with the SDK's quoteDomain(decodeMarketV3(...)); the example is the golden-vector market's."
  }
}
