{
  "path": "/futures/{settle}/autoorder/v1/trail/list",
  "operation_id": "getTrailOrders",
  "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",
      "required": false,
      "description": "Contract name",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "is_finished",
      "in": "query",
      "required": false,
      "description": "Whether historical order",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "start_at",
      "in": "query",
      "required": false,
      "description": "Start time of time range",
      "schema": {
        "type": "integer",
        "format": "int64"
      }
    },
    {
      "name": "end_at",
      "in": "query",
      "required": false,
      "description": "End time of time range",
      "schema": {
        "type": "integer",
        "format": "int64"
      }
    },
    {
      "name": "page_num",
      "in": "query",
      "required": false,
      "description": "Page number, starting from 1",
      "schema": {
        "type": "integer",
        "format": "int32",
        "default": 1
      }
    },
    {
      "name": "page_size",
      "in": "query",
      "required": false,
      "description": "Number of items per page",
      "schema": {
        "type": "integer",
        "format": "int32",
        "default": 20
      }
    },
    {
      "name": "sort_by",
      "in": "query",
      "required": false,
      "description": "Common sort field, 1-creation time, 2-end time",
      "schema": {
        "type": "integer",
        "format": "int32",
        "default": 1,
        "enum": [
          1,
          2
        ]
      }
    },
    {
      "name": "hide_cancel",
      "in": "query",
      "required": false,
      "description": "Hide cancelled orders",
      "schema": {
        "type": "boolean",
        "default": false
      }
    },
    {
      "name": "related_position",
      "in": "query",
      "required": false,
      "description": "Associated position, if provided, only return orders associated with this position, 1-long, 2-short",
      "schema": {
        "type": "integer",
        "format": "int32",
        "enum": [
          1,
          2
        ]
      }
    },
    {
      "name": "sort_by_trigger",
      "in": "query",
      "required": false,
      "description": "Sort by trigger price and activation price, easy to trigger or activate first, only for current orders associated with positions",
      "schema": {
        "type": "boolean",
        "default": false
      }
    },
    {
      "name": "reduce_only",
      "in": "query",
      "required": false,
      "description": "Whether reduce only, 1-yes, 2-no",
      "schema": {
        "type": "integer",
        "format": "int32",
        "enum": [
          1,
          2
        ]
      }
    },
    {
      "name": "side",
      "in": "query",
      "required": false,
      "description": "Direction, 1-long position, 2-short position",
      "schema": {
        "type": "integer",
        "format": "int32",
        "enum": [
          1,
          2
        ]
      }
    }
  ],
  "response_fields": {
    "200": {
      "description": "Query successful",
      "fields": [
        {
          "path": "$",
          "type": "object",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$.orders",
          "type": "array<object>",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$.orders[]",
          "type": "object",
          "description": "Trail order details",
          "constraints": ""
        },
        {
          "path": "$.orders[].id",
          "type": "integer",
          "description": "Order ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].user_id",
          "type": "integer",
          "description": "User ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].user",
          "type": "integer",
          "description": "User ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].contract",
          "type": "string",
          "description": "Contract name",
          "constraints": ""
        },
        {
          "path": "$.orders[].settle",
          "type": "string",
          "description": "Settle currency",
          "constraints": ""
        },
        {
          "path": "$.orders[].amount",
          "type": "string",
          "description": "Trading quantity in contracts, positive for buy, negative for sell",
          "constraints": ""
        },
        {
          "path": "$.orders[].is_gte",
          "type": "boolean",
          "description": "true: activate when market price >= activation price, false: <= activation price",
          "constraints": ""
        },
        {
          "path": "$.orders[].activation_price",
          "type": "string",
          "description": "Activation price, 0 means trigger immediately",
          "constraints": ""
        },
        {
          "path": "$.orders[].price_type",
          "type": "integer",
          "description": "Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price",
          "constraints": "格式：\"int32\"；枚举：0 / 1 / 2 / 3"
        },
        {
          "path": "$.orders[].price_offset",
          "type": "string",
          "description": "Callback ratio or price distance, e.g., `0.1` or `0.1%`",
          "constraints": ""
        },
        {
          "path": "$.orders[].text",
          "type": "string",
          "description": "Custom field",
          "constraints": ""
        },
        {
          "path": "$.orders[].reduce_only",
          "type": "boolean",
          "description": "Reduce Position Only",
          "constraints": ""
        },
        {
          "path": "$.orders[].position_related",
          "type": "boolean",
          "description": "Whether bound to position",
          "constraints": ""
        },
        {
          "path": "$.orders[].created_at",
          "type": "integer",
          "description": "Created time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].activated_at",
          "type": "integer",
          "description": "Activation time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].finished_at",
          "type": "integer",
          "description": "End time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].create_time",
          "type": "integer",
          "description": "Created time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].active_time",
          "type": "integer",
          "description": "Activation time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].finish_time",
          "type": "integer",
          "description": "End time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].reason",
          "type": "string",
          "description": "End reason",
          "constraints": ""
        },
        {
          "path": "$.orders[].suborder_text",
          "type": "string",
          "description": "Sub-order text field",
          "constraints": ""
        },
        {
          "path": "$.orders[].is_dual_mode",
          "type": "boolean",
          "description": "Whether dual position mode when creating order",
          "constraints": ""
        },
        {
          "path": "$.orders[].trigger_price",
          "type": "string",
          "description": "Trigger price",
          "constraints": ""
        },
        {
          "path": "$.orders[].suborder_id",
          "type": "integer",
          "description": "Sub-order ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].side_label",
          "type": "string",
          "description": "Order direction label: long/short/open long/open short/close long/close short",
          "constraints": ""
        },
        {
          "path": "$.orders[].original_status",
          "type": "integer",
          "description": "Order status",
          "constraints": "格式：\"int32\""
        },
        {
          "path": "$.orders[].status",
          "type": "string",
          "description": "Simplified order status: open/finished",
          "constraints": "枚举：open / finished"
        },
        {
          "path": "$.orders[].position_side_output",
          "type": "string",
          "description": "Same as side_label, client requires consistency with other order types",
          "constraints": ""
        },
        {
          "path": "$.orders[].updated_at",
          "type": "integer",
          "description": "Update time",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.orders[].extremum_price",
          "type": "string",
          "description": "Extremum price",
          "constraints": ""
        },
        {
          "path": "$.orders[].status_code",
          "type": "string",
          "description": "Status code value",
          "constraints": ""
        },
        {
          "path": "$.orders[].created_at_precise",
          "type": "string",
          "description": "Creation time (high precision, seconds.microseconds format)",
          "constraints": ""
        },
        {
          "path": "$.orders[].finished_at_precise",
          "type": "string",
          "description": "End time (high precision, seconds.microseconds format)",
          "constraints": ""
        },
        {
          "path": "$.orders[].activated_at_precise",
          "type": "string",
          "description": "Activation time (high precision, seconds.microseconds format)",
          "constraints": ""
        },
        {
          "path": "$.orders[].status_label",
          "type": "string",
          "description": "Status internationalization label (translated status text)",
          "constraints": ""
        },
        {
          "path": "$.orders[].pos_margin_mode",
          "type": "string",
          "description": "Position margin mode: isolated/cross",
          "constraints": ""
        },
        {
          "path": "$.orders[].position_mode",
          "type": "string",
          "description": "Position mode: single, dual, and dual_plus",
          "constraints": ""
        },
        {
          "path": "$.orders[].error_label",
          "type": "string",
          "description": "Error label",
          "constraints": ""
        },
        {
          "path": "$.orders[].leverage",
          "type": "string",
          "description": "Leverage",
          "constraints": ""
        }
      ]
    }
  },
  "source_version": "v4.106.132",
  "source_url": "https://github.com/gate/gateapi-python/blob/cd2cac4d339ec0734480787d23c020f467fd7b80/openapi.yaml",
  "local_tool_limits": [
    "仅检查必填、枚举和简单数值范围",
    "复杂类型序列化、条件必填、时间窗口等以官方规则为准",
    "不会发起 API 请求"
  ]
}
