{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cleartracedata-com/json-schema/cleartracedata-com-sandwiches-response-schema.json",
  "title": "SandwichesResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cleartracedata-com-openapi.yml#/components/schemas/SandwichesResponse",
  "properties": {
    "sandwiches": {
      "items": {
        "$ref": "#/$defs/SandwichEvent"
      },
      "type": "array",
      "title": "Sandwiches",
      "description": "Sandwich-attack events, newest first. The feed holds the largest victims per chain over the trailing 7 days (up to 125 per chain), not the most recent."
    },
    "total_attacks_7d": {
      "type": "integer",
      "title": "Total Attacks 7D",
      "description": "Cross-chain total sandwich attacks over the trailing 7 days, counting victims of at least victim_floor_usd. Read it with top_pair_share_of_attacks_pct: the FLOOR does not make this a market-wide figure, and a single pair has supplied a majority of it."
    },
    "total_sandwiched_usd_7d": {
      "type": "number",
      "title": "Total Sandwiched Usd 7D",
      "description": "Cross-chain total USD sandwiched over the trailing 7 days, over victims of at least victim_floor_usd."
    },
    "victim_floor_usd": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Victim Floor Usd",
      "description": "The victim-size floor applied to the 7-day totals (USD). Null means the data predates the floor (query v2) and the totals are unfloored."
    },
    "total_attacks_7d_raw": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Attacks 7D Raw",
      "description": "Cross-chain 7-day attack count with NO floor, for comparison with total_attacks_7d. Since 2026-09-29 one Base flow of sub-$1,000 rows dominates this figure -- and per top_pair_share_of_attacks_pct the same pair dominates the FLOORED count too, which the floor was not able to fix."
    },
    "total_sandwiched_usd_7d_raw": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Sandwiched Usd 7D Raw",
      "description": "Cross-chain 7-day sandwiched USD with NO floor."
    },
    "top_pair_7d": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Pair 7D",
      "description": "The token pair contributing the most attacks to the floored count. Null on data written before query v4."
    },
    "top_pair_blockchain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Pair Blockchain",
      "description": "The chain top_pair_7d trades on. The pair name alone is ambiguous; the concentration is one pool on one chain."
    },
    "top_pair_attacks_7d": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Pair Attacks 7D",
      "description": "How many of total_attacks_7d came from that one pair."
    },
    "top_pair_sandwiched_usd_7d": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Pair Sandwiched Usd 7D",
      "description": "How much of total_sandwiched_usd_7d came from that one pair."
    },
    "top_pair_share_of_attacks_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Pair Share Of Attacks Pct",
      "description": "top_pair_attacks_7d as a percentage of total_attacks_7d: 51.9% when measured on 2026-10-08. Above ~50 the count describes one pair's flow more than the market's. Dune's sandwich detector is curated, not ours, and its false-positive rate is not bounded here."
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Total number of matching events."
    },
    "limit": {
      "type": "integer",
      "title": "Limit",
      "description": "The maximum number of events returned."
    },
    "offset": {
      "type": "integer",
      "title": "Offset",
      "description": "The offset used for pagination."
    }
  },
  "type": "object",
  "required": [
    "sandwiches",
    "total_attacks_7d",
    "total_sandwiched_usd_7d",
    "total",
    "limit",
    "offset"
  ],
  "$defs": {
    "SandwichEvent": {
      "properties": {
        "tx_hash": {
          "type": "string",
          "title": "Tx Hash",
          "description": "The victim's on-chain transaction hash."
        },
        "block_time": {
          "type": "string",
          "title": "Block Time",
          "description": "Block timestamp of the victim transaction (UTC)."
        },
        "chain": {
          "type": "string",
          "title": "Chain",
          "description": "The blockchain the sandwich occurred on."
        },
        "project": {
          "type": "string",
          "title": "Project",
          "description": "The DEX whose pool was sandwiched."
        },
        "token_pair": {
          "type": "string",
          "title": "Token Pair",
          "description": "The token pair traded by the victim."
        },
        "victim_wallet": {
          "type": "string",
          "title": "Victim Wallet",
          "description": "The sandwiched wallet address."
        },
        "victim_volume_usd": {
          "type": "number",
          "title": "Victim Volume Usd",
          "description": "USD size of the victim's trade."
        },
        "chain_attacks_7d": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Chain Attacks 7D",
          "description": "Total sandwich attacks detected on this chain over the trailing 7 days."
        },
        "chain_sandwiched_usd_7d": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Chain Sandwiched Usd 7D",
          "description": "Total USD sandwiched on this chain over the trailing 7 days."
        }
      },
      "type": "object",
      "required": [
        "tx_hash",
        "block_time",
        "chain",
        "project",
        "token_pair",
        "victim_wallet",
        "victim_volume_usd"
      ],
      "title": "SandwichEvent"
    }
  }
}