{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api-evangelist.github.io/deribit/json-schema/public_trade.json",
  "title": "Public Trade",
  "properties": {
    "trade_id": {
      "$ref": "#/components/schemas/trade_id"
    },
    "trade_seq": {
      "$ref": "#/components/schemas/trade_seq"
    },
    "instrument_name": {
      "$ref": "#/components/schemas/instrument_name"
    },
    "timestamp": {
      "$ref": "#/components/schemas/trade_timestamp"
    },
    "direction": {
      "$ref": "#/components/schemas/direction",
      "description": "Trade direction of the taker"
    },
    "tick_direction": {
      "$ref": "#/components/schemas/tick_direction"
    },
    "index_price": {
      "type": "number",
      "description": "Index Price at the moment of trade"
    },
    "price": {
      "$ref": "#/components/schemas/price",
      "description": "The price of the trade"
    },
    "amount": {
      "type": "number",
      "description": "Trade amount. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin."
    },
    "contracts": {
      "type": "number",
      "description": "Trade size in contract units (optional, may be absent in historical trades)"
    },
    "iv": {
      "type": "number",
      "description": "Option implied volatility for the price (Option only)"
    },
    "liquidation": {
      "type": "string",
      "enum": [
        "M",
        "T",
        "MT"
      ],
      "description": "Optional field (only for trades caused by liquidation): `\"M\"` when maker side of trade was under liquidation, `\"T\"` when taker side was under liquidation, `\"MT\"` when both sides of trade were under liquidation"
    },
    "mark_price": {
      "type": "number",
      "description": "Mark Price at the moment of trade"
    },
    "block_trade_id": {
      "$ref": "#/components/schemas/block_trade_id_in_result"
    },
    "block_trade_leg_count": {
      "$ref": "#/components/schemas/block_trade_leg_count"
    },
    "combo_id": {
      "type": "string",
      "description": "Optional field containing combo instrument name if the trade is a combo trade"
    },
    "combo_trade_id": {
      "type": "number",
      "description": "Optional field containing combo trade identifier if the trade is a combo trade"
    },
    "block_rfq_id": {
      "type": "integer",
      "description": "ID of the Block RFQ - when trade was part of the Block RFQ"
    }
  },
  "required": [
    "trade_id",
    "instrument_name",
    "timestamp",
    "trade_seq",
    "direction",
    "tick_direction",
    "index_price",
    "price",
    "amount",
    "mark_price"
  ],
  "type": "object"
}