{
  "path": "/spot/trades",
  "operation_id": "listTrades",
  "auth_required": false,
  "parameters": [
    {
      "name": "currency_pair",
      "in": "query",
      "description": "Currency pair",
      "required": true,
      "schema": {
        "type": "string"
      },
      "example": "BTC_USDT"
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int32",
        "default": 100,
        "minimum": 1,
        "maximum": 1000
      },
      "example": 100
    },
    {
      "name": "last_id",
      "in": "query",
      "description": "Use the ID of the last record in the previous list as the starting point for the next list\n\nOperations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used",
      "required": false,
      "schema": {
        "type": "string"
      },
      "example": "12345"
    },
    {
      "name": "reverse",
      "in": "query",
      "required": false,
      "description": "Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`.\n\nSet to `true` to trace back market trade records, `false` to get latest trades.\n\nNo effect when `last_id` is not set.",
      "schema": {
        "type": "boolean",
        "default": false
      },
      "example": true,
      "deprecated": true
    },
    {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Start timestamp for the query",
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1627706330
    },
    {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "End timestamp for the query, defaults to current time if not specified",
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1635329650
    },
    {
      "name": "page",
      "in": "query",
      "description": "Page number",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int32",
        "default": 1,
        "minimum": 1
      },
      "example": 1
    }
  ],
  "response_fields": {
    "200": {
      "description": "List retrieved successfully",
      "fields": [
        {
          "path": "$",
          "type": "array<object>",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$[]",
          "type": "object",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$[].id",
          "type": "string",
          "description": "Fill ID",
          "constraints": ""
        },
        {
          "path": "$[].create_time",
          "type": "string",
          "description": "Fill Time",
          "constraints": ""
        },
        {
          "path": "$[].create_time_ms",
          "type": "string",
          "description": "Trading time, with millisecond precision",
          "constraints": ""
        },
        {
          "path": "$[].currency_pair",
          "type": "string",
          "description": "Currency pair",
          "constraints": ""
        },
        {
          "path": "$[].side",
          "type": "string",
          "description": "Buy or sell order",
          "constraints": "枚举：buy / sell"
        },
        {
          "path": "$[].role",
          "type": "string",
          "description": "Trade role, not returned in public endpoints",
          "constraints": "枚举：taker / maker"
        },
        {
          "path": "$[].amount",
          "type": "string",
          "description": "Trade amount",
          "constraints": ""
        },
        {
          "path": "$[].price",
          "type": "string",
          "description": "Order price",
          "constraints": ""
        },
        {
          "path": "$[].order_id",
          "type": "string",
          "description": "Related order ID, not returned in public endpoints",
          "constraints": ""
        },
        {
          "path": "$[].fee",
          "type": "string",
          "description": "Fee deducted, not returned in public endpoints",
          "constraints": ""
        },
        {
          "path": "$[].fee_currency",
          "type": "string",
          "description": "Fee currency unit, not returned in public endpoints",
          "constraints": ""
        },
        {
          "path": "$[].point_fee",
          "type": "string",
          "description": "Points used to deduct fee, not returned in public endpoints",
          "constraints": ""
        },
        {
          "path": "$[].gt_fee",
          "type": "string",
          "description": "GT used to deduct fee, not returned in public endpoints",
          "constraints": ""
        },
        {
          "path": "$[].amend_text",
          "type": "string",
          "description": "The custom data that the user remarked when amending the order",
          "constraints": ""
        },
        {
          "path": "$[].sequence_id",
          "type": "string",
          "description": "Consecutive trade ID within a single market.\nUsed to track and identify trades in the specific market",
          "constraints": ""
        },
        {
          "path": "$[].text",
          "type": "string",
          "description": "Order's Custom Information. This field is not returned by public interfaces.\nThe scenarios pm_liquidate, comb_margin_liquidate, and scm_liquidate represent full-account forced liquidation orders.\nliquidate represents isolated-account forced liquidation orders.",
          "constraints": ""
        },
        {
          "path": "$[].deal",
          "type": "string",
          "description": "Total Executed Value",
          "constraints": ""
        },
        {
          "path": "$[].trade_quote",
          "type": "string",
          "description": "Actual quote currency used for the trade",
          "constraints": ""
        }
      ]
    }
  },
  "source_version": "v4.106.132",
  "source_url": "https://github.com/gate/gateapi-python/blob/cd2cac4d339ec0734480787d23c020f467fd7b80/openapi.yaml",
  "local_tool_limits": [
    "仅检查必填、枚举和简单数值范围",
    "复杂类型序列化、条件必填、时间窗口等以官方规则为准",
    "不会发起 API 请求"
  ]
}
