{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cleartracedata-com/json-schema/cleartracedata-com-transactions-response-schema.json",
  "title": "TransactionsResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cleartracedata-com-openapi.yml#/components/schemas/TransactionsResponse",
  "properties": {
    "transactions": {
      "items": {
        "$ref": "#/$defs/Transaction"
      },
      "type": "array",
      "title": "Transactions",
      "description": "A sample of recent on-chain DEX transactions, refreshed on each data sync."
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Total number of matching transactions."
    },
    "limit": {
      "type": "integer",
      "title": "Limit",
      "description": "The maximum number of transactions returned."
    },
    "offset": {
      "type": "integer",
      "title": "Offset",
      "description": "The offset used for pagination."
    }
  },
  "type": "object",
  "required": [
    "transactions",
    "total",
    "limit",
    "offset"
  ],
  "$defs": {
    "Transaction": {
      "properties": {
        "tx_hash": {
          "type": "string",
          "title": "Tx Hash",
          "description": "The on-chain transaction hash."
        },
        "timestamp": {
          "type": "integer",
          "title": "Timestamp",
          "description": "The Unix timestamp of the block containing the transaction."
        },
        "chain": {
          "type": "string",
          "title": "Chain",
          "description": "The blockchain the transaction executed on."
        },
        "dex_project": {
          "type": "string",
          "title": "Dex Project",
          "description": "The DEX project whose pools the trade executed against."
        },
        "aggregator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aggregator",
          "description": "The aggregator that routed the trade, if any (null for direct trades)."
        },
        "token_sold": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Sold",
          "description": "Symbol of the token sold (largest leg)."
        },
        "token_bought": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Bought",
          "description": "Symbol of the token bought (largest leg)."
        },
        "routing_legs": {
          "type": "integer",
          "title": "Routing Legs",
          "description": "Number of DEX pool legs executed within the transaction."
        },
        "volume_usd": {
          "type": "number",
          "title": "Volume Usd",
          "description": "Total trade volume across all legs in USD."
        },
        "gas_used": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gas Used",
          "description": "Gas units consumed (from the Alchemy transaction receipt)."
        },
        "gas_fee_eth": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gas Fee Eth",
          "description": "Total gas fee paid in ETH (gas_used x effective gas price)."
        },
        "gas_fee_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gas Fee Usd",
          "description": "Total gas fee in USD at current ETH price."
        },
        "succeeded": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Succeeded",
          "description": "Whether the transaction succeeded on-chain (from the receipt status)."
        }
      },
      "type": "object",
      "required": [
        "tx_hash",
        "timestamp",
        "chain",
        "dex_project",
        "routing_legs",
        "volume_usd"
      ],
      "title": "Transaction"
    }
  }
}