{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cow-protocol/json-schema/cow-protocol-solve-response-schema.json",
  "title": "SolveResponse",
  "description": "Response of the solve endpoint.\n",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/driver.yml#/components/schemas/SolveResponse",
  "type": "object",
  "properties": {
    "solutions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "solutionId": {
            "description": "The unique identifier of the solution.\nThis id is used to identify the solution when executing it.",
            "type": "integer"
          },
          "score": {
            "description": "The objective value of the solution.\n",
            "type": "string"
          },
          "submissionAddress": {
            "allOf": [
              {
                "description": "The address that will be used to submit the solution."
              },
              {
                "$ref": "#/$defs/Address"
              }
            ]
          },
          "orders": {
            "description": "Mapping of order uid to net executed amount (including all fees). Each order may appear at most once: a partially fillable order can be split across multiple solutions, but not across multiple entries of the same solution. Solutions that violate this are rejected.\n",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "sellToken": {
                  "allOf": [
                    {
                      "description": "Token being sold"
                    },
                    {
                      "$ref": "#/$defs/Address"
                    }
                  ]
                },
                "buyToken": {
                  "allOf": [
                    {
                      "description": "Token being bought"
                    },
                    {
                      "$ref": "#/$defs/Address"
                    }
                  ]
                },
                "limitSell": {
                  "type": "string",
                  "description": "Maximum amount to be sold."
                },
                "limitBuy": {
                  "type": "string",
                  "description": "Minimum amount to be bought."
                },
                "executedSell": {
                  "type": "string",
                  "description": "The effective amount that left the user's wallet including all fees."
                },
                "executedBuy": {
                  "type": "string",
                  "description": "The effective amount the user received after all fees."
                }
              }
            }
          },
          "clearingPrices": {
            "deprecated": true,
            "description": "Deprecated. The autopilot no longer consumes uniform clearing prices from the `/solve` response and ignores this field if present. It is still emitted by drivers for backward compatibility with autopilots running the previous code, and will be removed in a follow-up release.\n\nMapping of hex token address to price. The prices of tokens for settled user orders as passed to the settlement contract.\n",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/BigUint"
            }
          },
          "gas": {
            "type": "integer"
          }
        }
      }
    }
  },
  "$defs": {
    "Address": {
      "description": "20 byte Ethereum address encoded as a hex with `0x` prefix.",
      "type": "string"
    },
    "BigUint": {
      "description": "A big unsigned integer encoded in decimal.",
      "type": "string"
    }
  }
}