{
  "path": "/futures/{settle}/my_trades_timerange",
  "operation_id": "getMyTradesWithTimeRange",
  "auth_required": true,
  "parameters": [
    {
      "name": "settle",
      "in": "path",
      "description": "Perpetual futures settlement currency",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "btc",
          "usdt",
          "usd1"
        ]
      },
      "example": "usdt"
    },
    {
      "name": "contract",
      "in": "query",
      "description": "Futures contract, return related data only if specified",
      "required": false,
      "schema": {
        "type": "string"
      },
      "example": "BTC_USDT"
    },
    {
      "name": "from",
      "in": "query",
      "description": "Start timestamp\n\nSpecify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1547706332
    },
    {
      "name": "to",
      "in": "query",
      "description": "Termination Timestamp\n\nSpecify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1547706332
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Maximum number of records returned in a single list",
      "required": false,
      "schema": {
        "type": "integer",
        "default": 100,
        "minimum": 1,
        "maximum": 1000
      },
      "example": 100
    },
    {
      "name": "offset",
      "in": "query",
      "description": "List offset, starting from 0",
      "required": false,
      "schema": {
        "type": "integer",
        "default": 0,
        "minimum": 0
      },
      "example": 0
    },
    {
      "name": "role",
      "in": "query",
      "description": "Query role, maker or taker",
      "required": false,
      "schema": {
        "type": "string"
      },
      "example": "maker"
    }
  ],
  "response_fields": {
    "200": {
      "description": "List retrieved successfully",
      "fields": [
        {
          "path": "$",
          "type": "array<object>",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$[]",
          "type": "object",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$[].trade_id",
          "type": "string",
          "description": "Fill ID",
          "constraints": ""
        },
        {
          "path": "$[].create_time",
          "type": "number",
          "description": "Fill Time",
          "constraints": "格式：\"double\""
        },
        {
          "path": "$[].contract",
          "type": "string",
          "description": "Futures contract",
          "constraints": ""
        },
        {
          "path": "$[].order_id",
          "type": "string",
          "description": "Related order ID",
          "constraints": ""
        },
        {
          "path": "$[].size",
          "type": "string",
          "description": "Trading size",
          "constraints": ""
        },
        {
          "path": "$[].close_size",
          "type": "string",
          "description": "Number of closed positions:\n\nclose_size=0 && size＞0 Open long position\nclose_size=0 && size＜0 Open short position\nclose_size>0 && size>0 && size <= close_size Close short position\nclose_size>0 && size>0 && size > close_size Close short position and open long position\nclose_size<0 && size<0 && size >= close_size Close long position\nclose_size<0 && size<0 && size < close_size Close long position and open short position",
          "constraints": ""
        },
        {
          "path": "$[].price",
          "type": "string",
          "description": "Fill Price",
          "constraints": ""
        },
        {
          "path": "$[].role",
          "type": "string",
          "description": "Trade role. taker - taker, maker - maker",
          "constraints": "枚举：taker / maker"
        },
        {
          "path": "$[].text",
          "type": "string",
          "description": "Order custom information",
          "constraints": ""
        },
        {
          "path": "$[].fee",
          "type": "string",
          "description": "Trade fee",
          "constraints": ""
        },
        {
          "path": "$[].point_fee",
          "type": "string",
          "description": "Points used to deduct trade fee",
          "constraints": ""
        }
      ]
    }
  },
  "source_version": "v4.106.132",
  "source_url": "https://github.com/gate/gateapi-python/blob/cd2cac4d339ec0734480787d23c020f467fd7b80/openapi.yaml",
  "local_tool_limits": [
    "仅检查必填、枚举和简单数值范围",
    "复杂类型序列化、条件必填、时间窗口等以官方规则为准",
    "不会发起 API 请求"
  ]
}
