{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/farmdash/json-schema/farmdash-swap-simulation-response-schema.json",
  "title": "SwapSimulationResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/farmdash-risk-api-openapi.yml#/components/schemas/SwapSimulationResponse",
  "type": "object",
  "required": [
    "ok",
    "simulation_id",
    "intent_id",
    "success",
    "gas_used",
    "gas_cost_usd",
    "output_amount",
    "mev_risk",
    "valid_until",
    "wallet_address",
    "selected_protocol",
    "required_for_execution"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "simulation_id": {
      "type": "string"
    },
    "intent_id": {
      "type": "string"
    },
    "success": {
      "type": "boolean"
    },
    "gas_used": {
      "type": "number"
    },
    "gas_cost_usd": {
      "type": "number"
    },
    "output_amount": {
      "type": "string"
    },
    "price_impact_pct": {
      "type": [
        "number",
        "null"
      ]
    },
    "mev_risk": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "revert_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "valid_until": {
      "type": "string",
      "format": "date-time"
    },
    "wallet_address": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$"
    },
    "selected_protocol": {
      "$ref": "#/$defs/SupportedProtocol"
    },
    "tx_fingerprint": {
      "type": "string"
    },
    "request_fingerprint": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "required_for_execution": {
      "type": "boolean",
      "const": true
    }
  },
  "$defs": {
    "SupportedProtocol": {
      "type": "string",
      "enum": [
        "lifi",
        "relay"
      ],
      "description": "Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback)."
    }
  }
}