{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/farmdash/json-schema/farmdash-history-response-schema.json",
  "title": "HistoryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/farmdash-history-api-openapi.yml#/components/schemas/HistoryResponse",
  "type": "object",
  "required": [
    "events",
    "total",
    "limit",
    "offset"
  ],
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeeEvent"
      }
    },
    "total": {
      "type": "integer"
    },
    "limit": {
      "type": "integer"
    },
    "offset": {
      "type": "integer"
    }
  },
  "$defs": {
    "FeeEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "protocol": {
          "$ref": "#/$defs/SupportedProtocol"
        },
        "from_token": {
          "type": "string"
        },
        "to_token": {
          "type": "string"
        },
        "volume_usd": {
          "type": "number"
        },
        "fee_bps": {
          "type": "integer"
        },
        "fee_usd": {
          "type": "number"
        },
        "agent_address": {
          "type": "string"
        },
        "tx_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "settlement_status": {
          "type": "string",
          "enum": [
            "pending",
            "confirmed",
            "expired",
            "legacy"
          ]
        },
        "chain_id": {
          "type": "integer"
        }
      }
    },
    "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)."
    }
  }
}