---
updatedAt: 2026-04-26T18:58:54.000Z
agentTools:
  projectIndex: https://docs.kyan.blue/llms.txt
---

# Fill RFQ

Execute a trade based on an RFQ response

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Premia V4 Public API",
    "description": "Public API for the Premia V4 platform providing traders and developers with programmatic access to options and perpetual futures trading.\nThis comprehensive API enables you to access market data, manage accounts, execute trades, and analyze portfolio risk with appropriate authentication.\n\n## Key Identifier Types\nThe API uses two primary identifier types throughout the trading system:\n- **order_id**: Unique identifier for individual limit orders. Generated as a 32-character hexadecimal string when a limit order is posted to the orderbook. Used for order management operations such as cancellation and status tracking.\n- **trade_id**: Unique identifier for executed trades. Generated as a 32-character hexadecimal string when a market order is filled against limit orders. Used for trade history tracking and settlement records.\n**Relationship**: Multiple trades can reference the same order_id when a single limit order is filled across multiple market orders (partial fills). Each trade execution generates a unique trade_id.\n\nThis document is organized following standard categories to help you integrate with the platform:\n1. Authentication/Session Management - API authentication methods and one-click trading sessions\n2. Market Data - Access real-time information about available instruments and market state\n3. Trading - Execute trades, place orders, and manage your positions \n4. Block RFQ - Request for Quote functionality for larger or custom trades\n5. Wallet - Deposit, withdraw, and transfer funds\n6. Account Management - Manage your trading account and view risk metrics\n",
    "version": "1.0.0",
    "contact": {
      "name": "Premia API Team",
      "url": "https://premia.io"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://premia.io/license"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.kyan.sh",
      "description": "Sandbox server (REST API)"
    },
    {
      "url": "https://staging.kyan.sh",
      "description": "Staging server (REST API)"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Block RFQ",
      "description": "Request for Quote operations for large or custom trades"
    }
  ],
  "externalDocs": {
    "description": "Complete API Documentation",
    "url": "https://docs.kyan.blue/reference"
  },
  "paths": {
    "/rfq/fill": {
      "post": {
        "tags": [
          "Block RFQ"
        ],
        "summary": "Fill RFQ",
        "description": "Execute a trade based on an RFQ response",
        "operationId": "fillRfq",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RFQFillRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully filled RFQ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComboTradeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. Includes pre-trade risk rejections: `RFQ_FILL_TAKER_RISK_FAILED` (the fill would breach the taker's margin/risk limits) and `RFQ_FILL_MAKER_RISK_FAILED` (the fill would breach the maker's margin/risk limits).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid signature or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "RFQ response not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "requested entity not found"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-apikey",
        "description": "API key for authentication. Generate and manage your own at https://app.kyan.blue/portfolio/api"
      }
    },
    "schemas": {
      "Address": {
        "type": "string",
        "pattern": "^0x[a-fA-F0-9]{40}$",
        "description": "Ethereum address in hexadecimal format",
        "example": "0x9a2f0C371820e8BE3D64efb3E814808F231880ff"
      },
      "ComboTradeResponse": {
        "type": "object",
        "properties": {
          "fillResult": {
            "$ref": "#/components/schemas/PostMarketComboOrderResponse"
          },
          "filledOrders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoredLimitOrder"
            },
            "description": "Orders that were filled"
          }
        },
        "required": [
          "fillResult",
          "filledOrders"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message",
            "example": "payload validation error"
          }
        },
        "required": [
          "error"
        ]
      },
      "OptionLimitOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PostOptionsLimitRequest"
          },
          {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Order ID for this limit order",
                "pattern": "^[a-fA-F0-9]{32}$",
                "example": "1234567890abcdef1234567890abcdef"
              },
              "order_state": {
                "type": "string",
                "enum": [
                  "open",
                  "filled",
                  "rejected"
                ],
                "description": "Order state"
              },
              "filled_amount": {
                "type": "number",
                "format": "double",
                "description": "Confirmed filled size (settlement-confirmed fills only), in contracts for options. Orders currently being matched (inflight) show 0 until the fill is confirmed.",
                "example": 0.5
              },
              "filled_contracts": {
                "type": "number",
                "format": "double",
                "description": "Confirmed filled size in base contracts (canonical). For options this equals `filled_amount`.",
                "example": 0.5
              },
              "iv": {
                "type": "number",
                "format": "double",
                "description": "Implied volatility",
                "example": 0.5
              },
              "creation_timestamp": {
                "type": "integer",
                "format": "int64",
                "description": "Creation timestamp in Unix seconds",
                "example": 1704067200
              },
              "chain_id": {
                "type": "integer",
                "format": "int32",
                "description": "Chain ID",
                "example": 42161
              }
            },
            "required": [
              "order_id",
              "order_state",
              "filled_amount",
              "creation_timestamp",
              "chain_id"
            ]
          }
        ]
      },
      "PerpLimitOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PostPerpsLimitRequest"
          },
          {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "pattern": "^[a-fA-F0-9]{32}$",
                "description": "Order ID for this perpetual limit order",
                "example": "1234567890abcdef1234567890abcdef"
              },
              "order_state": {
                "type": "string",
                "enum": [
                  "open",
                  "filled",
                  "rejected"
                ],
                "description": "Order state"
              },
              "filled_amount": {
                "type": "number",
                "format": "double",
                "description": "Confirmed filled size (settlement-confirmed fills only), as USD notional for perpetuals. Orders currently being matched (inflight) show 0 until the fill is confirmed.",
                "example": 5000.05
              },
              "filled_contracts": {
                "type": "number",
                "format": "double",
                "description": "Confirmed filled size in base contracts (canonical) — the fill-side analog of `contracts`.",
                "example": 0.1
              },
              "creation_timestamp": {
                "type": "integer",
                "format": "int64",
                "description": "Creation timestamp in Unix seconds",
                "example": 1704067200
              },
              "chain_id": {
                "type": "integer",
                "format": "int32",
                "description": "Chain ID",
                "example": 42161
              }
            },
            "required": [
              "order_id",
              "order_state",
              "filled_amount",
              "creation_timestamp",
              "chain_id"
            ]
          }
        ]
      },
      "PostMarketComboOrderResponse": {
        "type": "object",
        "properties": {
          "options": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/PostOptionLegMarket"
                },
                {
                  "type": "object",
                  "properties": {
                    "average_price": {
                      "type": "number",
                      "format": "double",
                      "description": "Average execution price"
                    }
                  },
                  "required": [
                    "average_price"
                  ]
                }
              ]
            }
          },
          "perp": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PostPerpLegMarket"
              },
              {
                "type": "object",
                "properties": {
                  "average_price": {
                    "type": "number",
                    "format": "double",
                    "description": "Average execution price"
                  }
                },
                "required": [
                  "average_price"
                ]
              }
            ]
          },
          "total_net_premium": {
            "type": "number",
            "format": "double",
            "description": "Signed net premium for the options legs of the combo. Negative means the taker pays (net debit), positive means the taker receives (net credit). Only options legs contribute to this value; perpetual legs are excluded.\n"
          },
          "taker": {
            "$ref": "#/components/schemas/Address"
          },
          "trade_id": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "Trade ID for this market combo order execution",
            "example": "863509b1a865fa3f502a9f6784122dd7"
          },
          "fees": {
            "type": "object",
            "properties": {
              "taker_fee": {
                "type": "number",
                "format": "double",
                "description": "Taker fee"
              }
            },
            "required": [
              "taker_fee"
            ]
          }
        },
        "required": [
          "options",
          "total_net_premium",
          "taker",
          "trade_id",
          "fees"
        ]
      },
      "PostOptionLegMarket": {
        "type": "object",
        "title": "Options Market Order",
        "properties": {
          "instrument_name": {
            "type": "string",
            "pattern": "^[A-Z]+_[A-Z]+-[0-9]{2}[A-Z]{3}[0-9]{2}-[0-9]+-[CP]$",
            "description": "Instrument name in the format `{base}_{quote}-{maturity}-{strike}-{type}`",
            "example": "BTC_USDC-31OCT25-130000-C"
          },
          "contracts": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Number of option contracts",
            "example": 25
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Order direction"
          },
          "user_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Optional user identifier for tracking and analytics purposes"
          }
        },
        "required": [
          "instrument_name",
          "contracts",
          "direction"
        ]
      },
      "PostOptionsLimitRequest": {
        "type": "object",
        "title": "Options Limit Order",
        "properties": {
          "instrument_name": {
            "type": "string",
            "pattern": "^[A-Z]+_[A-Z]+-[0-9]{2}[A-Z]{3}[0-9]{2}-[0-9]+-[CP]$",
            "description": "Instrument name in the format `{base}_{quote}-{maturity}-{strike}-{type}`",
            "example": "BTC_USDC-31OCT25-130000-C"
          },
          "type": {
            "type": "string",
            "enum": [
              "good_til_cancelled",
              "good_til_day"
            ],
            "description": "Order type"
          },
          "contracts": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Number of option contracts",
            "example": 1.5
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Order direction"
          },
          "price": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Limit price",
            "example": 1000.5
          },
          "post_only": {
            "type": "boolean",
            "description": "If true, ensures the order will only be added to the order book and not match against existing orders. Orders that would immediately match will be rejected."
          },
          "mmp": {
            "type": "boolean",
            "description": "Opts this order into Market Maker Protection (MMP). When `true`, this order is tracked against MMP risk thresholds and will be automatically cancelled if MMP triggers. When MMP is frozen (after a trigger), new orders with `mmp: true` are rejected while orders with `mmp: false` can still be placed. The `mmp` value is part of the EIP-712 signature and cannot be changed after signing. See `POST /mmp_config` for full MMP documentation."
          },
          "liquidation": {
            "type": "boolean",
            "description": "Internal field used for liquidation orders. Regular traders should set this to false."
          },
          "maker": {
            "$ref": "#/components/schemas/Address"
          },
          "taker": {
            "$ref": "#/components/schemas/Address",
            "description": "Must be the zero address (0x0000000000000000000000000000000000000000), indicating any taker can fill the order",
            "pattern": "^0x0{40}$"
          },
          "signature": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{130}$",
            "description": "EIP-712 signature (required when not using x-one-click session)"
          },
          "signature_deadline": {
            "type": "integer",
            "format": "int64",
            "minimum": 1704067200,
            "maximum": 2019686400,
            "description": "Signature deadline in Unix seconds (required when not using x-one-click session)"
          },
          "user_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Optional user identifier for tracking and analytics purposes"
          }
        },
        "required": [
          "instrument_name",
          "type",
          "contracts",
          "direction",
          "price",
          "post_only",
          "mmp",
          "liquidation",
          "maker"
        ]
      },
      "PostPerpLegMarket": {
        "title": "Perpetual Market Order",
        "properties": {
          "instrument_name": {
            "type": "string",
            "pattern": "^[A-Z]+_[A-Z]+-PERPETUAL$",
            "description": "Instrument name in the format `{base}_{quote}-PERPETUAL`",
            "example": "BTC_USDC-PERPETUAL"
          },
          "contracts": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Order size in base contracts (canonical). Perpetual order size is denominated in base contracts of the underlying asset — the same unit used for options. Supply exactly one of `contracts` or `amount`. Required (and `amount` is not accepted) when this leg is part of an RFQ request.",
            "example": 4
          },
          "amount": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Legacy order size in USD notional. **Deprecated and will be removed in a future release** — the notional model is being replaced by `contracts` (base contracts). Accepted only for backward compatibility on `/market`; migrate to `contracts`. Not accepted on RFQ perp legs. Supply exactly one of `contracts` or `amount`.",
            "example": 200000
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Order direction"
          },
          "user_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Optional user identifier for tracking and analytics purposes"
          }
        },
        "required": [
          "instrument_name",
          "direction"
        ],
        "oneOf": [
          {
            "required": [
              "contracts"
            ]
          },
          {
            "required": [
              "amount"
            ]
          }
        ],
        "x-readme": {
          "explorer-enabled": true
        }
      },
      "PostPerpsLimitRequest": {
        "title": "Perpetual Limit Order",
        "properties": {
          "instrument_name": {
            "type": "string",
            "pattern": "^[A-Z]+_[A-Z]+-PERPETUAL$",
            "description": "Instrument name in the format `{base}_{quote}-PERPETUAL`",
            "example": "BTC_USDC-PERPETUAL"
          },
          "type": {
            "type": "string",
            "enum": [
              "good_til_cancelled",
              "good_til_day"
            ],
            "description": "Order type"
          },
          "contracts": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Order size in base contracts (canonical). Perpetual order size is denominated in base contracts of the underlying asset — the same unit used for options. Supply exactly one of `contracts` or `amount`.",
            "example": 0.2
          },
          "amount": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Legacy order size in USD notional. **Deprecated and will be removed in a future release** — the notional model is being replaced by `contracts` (base contracts). Accepted only for backward compatibility; migrate to `contracts`. When supplied instead of `contracts`, the notional is converted to base contracts at the order `price`. Supply exactly one of `contracts` or `amount`.",
            "example": 10000
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Order direction"
          },
          "price": {
            "type": "number",
            "format": "double",
            "minimum": 0.000001,
            "multipleOf": 0.000001,
            "description": "Limit price",
            "example": 50000.5
          },
          "post_only": {
            "type": "boolean",
            "description": "If true, ensures the order will only be added to the order book and not match against existing orders. Orders that would immediately match will be rejected."
          },
          "mmp": {
            "type": "boolean",
            "description": "Opts this order into Market Maker Protection (MMP). When `true`, this order is tracked against MMP risk thresholds and will be automatically cancelled if MMP triggers. When MMP is frozen (after a trigger), new orders with `mmp: true` are rejected while orders with `mmp: false` can still be placed. The `mmp` value is part of the EIP-712 signature and cannot be changed after signing. See `POST /mmp_config` for full MMP documentation."
          },
          "liquidation": {
            "type": "boolean",
            "description": "Internal field used for liquidation orders. Regular traders should set this to false."
          },
          "maker": {
            "$ref": "#/components/schemas/Address"
          },
          "taker": {
            "$ref": "#/components/schemas/Address",
            "description": "Must be the zero address (0x0000000000000000000000000000000000000000), indicating any taker can fill the order",
            "pattern": "^0x0{40}$"
          },
          "signature": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{130}$",
            "description": "EIP-712 signature (required when not using x-one-click session)"
          },
          "signature_deadline": {
            "type": "integer",
            "format": "int64",
            "minimum": 1704067200,
            "maximum": 2019686400,
            "description": "Signature deadline in Unix seconds (required when not using x-one-click session)"
          },
          "user_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Optional user identifier for tracking and analytics purposes"
          }
        },
        "required": [
          "instrument_name",
          "type",
          "direction",
          "price",
          "post_only",
          "mmp",
          "liquidation",
          "maker"
        ],
        "oneOf": [
          {
            "required": [
              "contracts"
            ]
          },
          {
            "required": [
              "amount"
            ]
          }
        ],
        "x-readme": {
          "explorer-enabled": true
        }
      },
      "RFQFillRequest": {
        "type": "object",
        "properties": {
          "taker": {
            "$ref": "#/components/schemas/TakerAddress"
          },
          "response_id": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "RFQ response ID"
          },
          "signature": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{130}$",
            "description": "EIP-712 signature"
          },
          "signature_deadline": {
            "type": "integer",
            "format": "int64",
            "minimum": 1704067200,
            "maximum": 2019686400,
            "description": "Signature deadline in Unix seconds"
          }
        },
        "required": [
          "taker",
          "response_id"
        ]
      },
      "StoredLimitOrder": {
        "oneOf": [
          {
            "title": "Options Limit Order",
            "$ref": "#/components/schemas/OptionLimitOrder"
          },
          {
            "title": "Perpetual Limit Order",
            "$ref": "#/components/schemas/PerpLimitOrder"
          }
        ],
        "description": "A stored limit order, either for options or perpetuals",
        "x-readme": {
          "explorer-enabled": true
        }
      },
      "TakerAddress": {
        "type": "string",
        "pattern": "^0x[a-fA-F0-9]{40}$",
        "description": "Taker's Ethereum address in hexadecimal format",
        "example": "0xf1808cc5298036762329b56b261246c0b77EBb18"
      }
    }
  }
}
```