openapi: 3.0.2
info:
  title: Margin REST API
  description: 访问账户信息、借入和偿还资产，并通过 Binance 杠杆进行交易。
  version: 1.0.0
  termsOfService: https://www.binance.com/en/terms
  contact:
    name: Binance API Support
    url: https://www.binance.com/en/support
x-product-type: rest-api
x-rate-limits-guide: products/margin-trading/general-info#访问限制
x-security-guide: products/margin-trading/general-info#请求鉴权类型
x-api-key-guide: https://www.binance.com/cn/support/faq/detail/360002502072
externalDocs:
  description: Margin docs
  url: https://developers.binance.com/en/docs/products/margin-trading/Introduction
tags:
  - name: account
    x-displayName: 账户接口
  - name: borrow-repay
    x-displayName: 借贷还款接口
  - name: market-data
    x-displayName: 行情接口
  - name: user-data-stream
    x-displayName: 杠杆风控信息推送
  - name: trade
    x-displayName: 交易接口
  - name: transfer
    x-displayName: 划转接口
servers:
  - url: https://api.binance.com
  - url: https://api-gcp.binance.com
  - url: https://api1.binance.com
  - url: https://api2.binance.com
  - url: https://api3.binance.com
  - url: https://api4.binance.com
paths:
  /sapi/v1/margin/max-leverage:
    post:
      summary: 调整全仓最大杠杆 (USER_DATA)
      description: 调整全仓最大杠杆倍数
      tags:
        - account
      operationId: adjustCrossMarginMaxLeverage
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#adjust-cross-margin-max-leverage
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/adjustCrossMarginMaxLeverage.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/adjust_cross_margin_max_leverage.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/adjust_cross_margin_max_leverage.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/AdjustCrossMarginMaxLeverageExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/AdjustCrossMarginMaxLeverage/AdjustCrossMarginMaxLeverage.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/AdjustCrossMarginMaxLeverageExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 3000, 1 times/min per IP
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: '- 当前的风险率需要大于调整后的初始风险率，3x的初始风险率是1.5，5x的初始风险率是1.25，关于在Classic模式(3x, 5x) 和Pro模式(10x, 20x)之间的切换条件请参考[FAQ](https://www.binance.com/zh-CN/support/faq/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%B8%81%E5%AE%89%E5%BC%80%E9%80%9A%E5%85%A8%E4%BB%93%E6%9D%A0%E6%9D%86%E4%B8%93%E4%B8%9A%E6%A8%A1%E5%BC%8F-e27786da05e743a694b8c625b3bc475d)。'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - maxLeverage
                - timestamp
              properties:
                maxLeverage:
                  type: integer
                  example: 3
                  format: int64
                  description: '只能调整3, 5 , 或者 10。举例: maxLeverage = 5 或者3是选择全仓Classic模式； maxLeverage=10 是选择切换成全仓 Pro 模式下的10倍杠杆 或者 20倍杠杆（在合规允许的情况下）。'
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Adjust cross 杠杆 最大leverage
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: 成功.
  /sapi/v1/margin/isolated/account:
    delete:
      summary: 杠杆逐仓账户停用 (TRADE)
      description: 停用特定交易对的杠杆逐仓账户。每个交易对 24 小时内仅可停用一次。
      tags:
        - account
      operationId: disableIsolatedMarginAccount
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#disable-isolated-margin-account
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/disableIsolatedMarginAccount.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/disable_isolated_margin_account.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/disable_isolated_margin_account.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/DisableIsolatedMarginAccountExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/DisableIsolatedMarginAccount/DisableIsolatedMarginAccount.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/DisableIsolatedMarginAccountExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 300
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTCUSDT
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 禁用Isolated 杠杆 账户
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: 成功.
                  symbol:
                    type: string
                    example: BTCUSDT
                    description: 交易对.
    post:
      summary: 杠杆逐仓账户启用 (TRADE)
      description: 启用特定交易对的杠杆逐仓账户（仅支持启用之前停用的账户）。
      tags:
        - account
      operationId: enableIsolatedMarginAccount
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#enable-isolated-margin-account
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/enableIsolatedMarginAccount.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/enable_isolated_margin_account.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/enable_isolated_margin_account.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/EnableIsolatedMarginAccountExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/EnableIsolatedMarginAccount/EnableIsolatedMarginAccount.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/EnableIsolatedMarginAccountExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 300
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - symbol
                - timestamp
              properties:
                symbol:
                  type: string
                  example: BTCUSDT
                recvWindow:
                  type: integer
                  example: 5000
                  maximum: 60000
                  format: int64
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 启用Isolated 杠杆 账户
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: 成功.
                  symbol:
                    type: string
                    example: BTCUSDT
                    description: 交易对.
    get:
      summary: 查询杠杆逐仓账户信息 (USER_DATA)
      description: 查询杠杆逐仓账户信息
      tags:
        - account
      operationId: queryIsolatedMarginAccountInfo
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-isolated-margin-account-info
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryIsolatedMarginAccountInfo.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_isolated_margin_account_info.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_isolated_margin_account_info.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryIsolatedMarginAccountInfoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryIsolatedMarginAccountInfo/QueryIsolatedMarginAccountInfo.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryIsolatedMarginAccountInfoExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbols
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT,BNBUSDT,ADAUSDT
            description: Max 5 交易对s can be sent; separated by ",".
            maximum: 5
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 不传"symbols",返回所有杠杆逐仓资产
        - 传"symbols", 将只会返回指定symbol的杠杆逐仓资产
      responses:
        '200':
          description: Isolated 杠杆 账户 Info
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: array
                    items:
                      type: object
                      properties:
                        baseAsset:
                          type: object
                          properties:
                            asset:
                              type: string
                              example: BTC
                              description: 资产.
                            borrowEnabled:
                              type: boolean
                              example: true
                              description: 借款 启用.
                            borrowed:
                              type: string
                              example: '0.00000000'
                              description: 借入.
                            free:
                              type: string
                              example: '0.00000000'
                              description: 可用.
                            interest:
                              type: string
                              example: '0.00000000'
                              description: 利息.
                            locked:
                              type: string
                              example: '0.00000000'
                              description: 冻结.
                            netAsset:
                              type: string
                              example: '0.00000000'
                              description: 净值 资产.
                            netAssetOfBtc:
                              type: string
                              example: '0.00000000'
                              description: 净值 资产 Of Btc.
                            repayEnabled:
                              type: boolean
                              example: true
                              description: 还款 启用.
                            totalAsset:
                              type: string
                              example: '0.00000000'
                              description: 总计 资产.
                          description: base 资产 object.
                        quoteAsset:
                          type: object
                          properties:
                            asset:
                              type: string
                              example: USDT
                              description: 资产.
                            borrowEnabled:
                              type: boolean
                              example: true
                              description: 借款 启用.
                            borrowed:
                              type: string
                              example: '0.00000000'
                              description: 借入.
                            free:
                              type: string
                              example: '0.00000000'
                              description: 可用.
                            interest:
                              type: string
                              example: '0.00000000'
                              description: 利息.
                            locked:
                              type: string
                              example: '0.00000000'
                              description: 冻结.
                            netAsset:
                              type: string
                              example: '0.00000000'
                              description: 净值 资产.
                            netAssetOfBtc:
                              type: string
                              example: '0.00000000'
                              description: 净值 资产 Of Btc.
                            repayEnabled:
                              type: boolean
                              example: true
                              description: 还款 启用.
                            totalAsset:
                              type: string
                              example: '0.00000000'
                              description: 总计 资产.
                          description: quote 资产 object.
                        symbol:
                          type: string
                          example: BTCUSDT
                          description: 交易对.
                        isolatedCreated:
                          type: boolean
                          example: true
                          description: 逐仓 Created.
                        enabled:
                          type: boolean
                          example: true
                          description: 账户是否启用，true-启用，false-停用
                        marginLevel:
                          type: string
                          example: '0.00000000'
                          description: 杠杆 Level.
                        marginLevelStatus:
                          type: string
                          example: EXCESSIVE
                          description: '"EXCESSIVE", "NORMAL", "杠杆_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"'
                        marginRatio:
                          type: string
                          example: '0.00000000'
                          description: 杠杆 Ratio.
                        indexPrice:
                          type: string
                          example: '10000.00000000'
                          description: index 价格.
                        liquidatePrice:
                          type: string
                          example: '1000.00000000'
                          description: liquidate 价格.
                        liquidateRate:
                          type: string
                          example: '1.00000000'
                          description: liquidate 利率.
                        tradeEnabled:
                          type: boolean
                          example: true
                          description: 交易 启用.
                    description: assets 列表.
                  totalAssetOfBtc:
                    type: string
                    example: '0.00000000'
                    description: 总计 资产 Of Btc.
                  totalLiabilityOfBtc:
                    type: string
                    example: '0.00000000'
                    description: 总计 Liability Of Btc.
                  totalNetAssetOfBtc:
                    type: string
                    example: '0.00000000'
                    description: 总计 净值 资产 Of Btc.
  /sapi/v1/bnbBurn:
    get:
      summary: 获取BNB抵扣开关状态 (USER_DATA)
      description: 获取BNB抵扣开关状态
      tags:
        - account
      operationId: getBnbBurnStatus
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#get-bnb-burn-status
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/getBnbBurnStatus.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/get_bnb_burn_status.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/get_bnb_burn_status.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/GetBnbBurnStatusExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/GetBnbBurnStatus/GetBnbBurnStatus.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/GetBnbBurnStatusExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 获取BNB Burn 状态
          content:
            application/json:
              schema:
                type: object
                properties:
                  spotBNBBurn:
                    type: boolean
                    example: true
                    description: 字段说明：spot BNBBurn.
                  interestBNBBurn:
                    type: boolean
                    example: false
                    description: 利息 BNBBurn.
  /sapi/v1/margin/tradeCoeff:
    get:
      summary: 查询Margin账户信息汇总 (USER_DATA)
      description: 获取用户个人杠杆账户信息汇总
      tags:
        - account
      operationId: getSummaryOfMarginAccount
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#get-summary-of-margin-account
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/getSummaryOfMarginAccount.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/get_summary_of_margin_account.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/get_summary_of_margin_account.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/GetSummaryOfMarginAccountExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/GetSummaryOfMarginAccount/GetSummaryOfMarginAccount.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/GetSummaryOfMarginAccountExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 获取Summary of 杠杆 账户
          content:
            application/json:
              schema:
                type: object
                properties:
                  normalBar:
                    type: string
                    example: '1.5'
                    description: 字段说明：normal Bar.
                  marginCallBar:
                    type: string
                    example: '1.3'
                    description: 杠杆 Call Bar.
                  forceLiquidationBar:
                    type: string
                    example: '1.1'
                    description: 强平 Bar.
  /sapi/v1/margin/capital-flow:
    get:
      summary: 查询全仓/逐仓资金流水 (USER_DATA)
      description: 查询全仓/逐仓资金流水
      tags:
        - account
      operationId: queryCrossIsolatedMarginCapitalFlow
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-cross-isolated-margin-capital-flow
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryCrossIsolatedMarginCapitalFlow.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_cross_isolated_margin_capital_flow.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_cross_isolated_margin_capital_flow.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryCrossIsolatedMarginCapitalFlowExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryCrossIsolatedMarginCapitalFlow/QueryCrossIsolatedMarginCapitalFlow.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryCrossIsolatedMarginCapitalFlowExample.php
      x-ip-weight: 100
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: false
          schema:
            type: string
            example: USDT
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
            description: Mandatory for 逐仓 数据
          description: 查询逐仓数据时必填
        - name: type
          in: query
          required: false
          schema:
            type: string
            example: TRANSFER
            enum:
              - TRANSFER
              - BORROW
              - REPAY
              - BUY_INCOME
              - BUY_EXPENSE
              - SELL_INCOME
              - SELL_EXPENSE
              - TRADING_COMMISSION
              - BUY_LIQUIDATION
              - SELL_LIQUIDATION
              - REPAY_LIQUIDATION
              - OTHER_LIQUIDATION
              - LIQUIDATION_FEE
              - SMALL_BALANCE_CONVERT
              - COMMISSION_RETURN
              - SMALL_CONVERT
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
            description: Only supports 查询 数据 from the past 90 days.
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: fromId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: If `fromId` is set, 数据 with `ID` greater than `fromId` will be returned. Otherwise, the latest 数据 will be returned.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            example: 500
            default: 500
            maximum: 1000
            format: int64
            description: 限制 on the number of 数据 records returned per 请求. ;
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
            description: 赋值不能大于 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 只支持查询最近90天的数据
        - startTime 和 endTime 的最大间隔为7天
        - 如设置`fromId`, 将返回`id` > `fromId`的数据。否则将返回最新订单。
        - 查询逐仓数据，需要输入`symbol`
      responses:
        '200':
          description: Cross Isolated 杠杆 Capital Flow
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      example: 123456
                      format: int64
                      description: 字段说明：ID.
                    tranId:
                      type: integer
                      example: 123123
                      format: int64
                      description: 字段说明：tran ID.
                    timestamp:
                      type: integer
                      example: 1691116657000
                      format: int64
                      description: 时间戳.
                    asset:
                      type: string
                      example: USDT
                      description: 资产.
                    symbol:
                      type: string
                      example: BTCUSDT
                      description: 交易对.
                    type:
                      type: string
                      example: BORROW
                      description: 类型.
                    amount:
                      type: string
                      example: '101'
                      description: 数量.
                    note:
                      type: string
                      example: INSTITUTIONAL_LOAN_TRANSFER
                      enum:
                        - INSTITUTIONAL_LOAN_TRANSFER
                        - INSTITUTIONAL_LOAN_BORROW
                        - INSTITUTIONAL_LOAN_REPAY
                      description: 备注.
  /sapi/v1/margin/account:
    get:
      summary: 查询全仓杠杆账户详情 (USER_DATA)
      description: 查询全仓杠杆账户详情
      tags:
        - account
      operationId: queryCrossMarginAccountDetails
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-cross-margin-account-details
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryCrossMarginAccountDetails.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_cross_margin_account_details.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_cross_margin_account_details.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryCrossMarginAccountDetailsExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryCrossMarginAccountDetails/QueryCrossMarginAccountDetails.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryCrossMarginAccountDetailsExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Cross 杠杆 账户 Details
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: boolean
                    example: true
                    description: true 表示已开户, false 表示未开户
                  borrowEnabled:
                    type: boolean
                    example: true
                    description: 借款 启用.
                  marginLevel:
                    type: string
                    example: '11.64405625'
                    description: 杠杆 Level.
                  collateralMarginLevel:
                    type: string
                    example: '3.2'
                    description: collateral 杠杆 Level.
                  totalAssetOfBtc:
                    type: string
                    example: '6.82728457'
                    description: 总计 资产 Of Btc.
                  totalLiabilityOfBtc:
                    type: string
                    example: '0.58633215'
                    description: 总计 Liability Of Btc.
                  totalNetAssetOfBtc:
                    type: string
                    example: '6.24095242'
                    description: 总计 净值 资产 Of Btc.
                  TotalCollateralValueInUSDT:
                    type: string
                    example: '5.82728457'
                    description: 总计 Collateral Value In USDT.
                  totalOpenOrderLossInUSDT:
                    type: string
                    example: '582.728457'
                    description: 总计 Open 订单 Loss In USDT.
                  tradeEnabled:
                    type: boolean
                    example: true
                    description: 交易 启用.
                  transferInEnabled:
                    type: boolean
                    example: true
                    description: 划转 In 启用.
                  transferOutEnabled:
                    type: boolean
                    example: true
                    description: 划转 Out 启用.
                  accountType:
                    type: string
                    example: MARGIN_1
                    description: MARGIN_1 全仓Classic模式账户, MARGIN_2 全仓Pro模式账户
                  userAssets:
                    type: array
                    items:
                      type: object
                      properties:
                        asset:
                          type: string
                          example: BTC
                          description: 资产.
                        borrowed:
                          type: string
                          example: '0.00000000'
                          description: 借入.
                        free:
                          type: string
                          example: '0.00499500'
                          description: 可用.
                        interest:
                          type: string
                          example: '0.00000000'
                          description: 利息.
                        locked:
                          type: string
                          example: '0.00000000'
                          description: 冻结.
                        netAsset:
                          type: string
                          example: '0.00499500'
                          description: 净值 资产.
                      example:
                        asset: BTC
                        borrowed: '0.00000000'
                        free: '0.00499500'
                        interest: '0.00000000'
                        locked: '0.00000000'
                        netAsset: '0.00499500'
                    description: user Assets 列表.
  /sapi/v1/margin/crossMarginData:
    get:
      summary: 获取全仓杠杆利率及限额 (USER_DATA)
      description: 通过VIP等级或用户当前VIP等级获取全仓杠杆利率及限额， 如：https://www.binance.com/en/margin-fee
      tags:
        - account
      operationId: queryCrossMarginFeeData
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-cross-margin-fee-data
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryCrossMarginFeeData.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_cross_margin_fee_data.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_cross_margin_fee_data.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryCrossMarginFeeDataExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryCrossMarginFeeData/QueryCrossMarginFeeData.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryCrossMarginFeeDataExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-weight: 1 when coin is specified;(IP) 5 when the coin parameter is omitted(IP)
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: vipLevel
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
          description: 默认为用户当前VIP等级
        - name: coin
          in: query
          required: false
          schema:
            type: string
            example: BTC
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Cross 杠杆 Fee Data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    vipLevel:
                      type: integer
                      example: 0
                      format: int64
                      description: vip 等级.
                    coin:
                      type: string
                      example: BTC
                      description: 字段说明：coin.
                    transferIn:
                      type: boolean
                      example: true
                      description: 划转 In.
                    borrowable:
                      type: boolean
                      example: true
                      description: 借款able.
                    dailyInterest:
                      type: string
                      example: '0.00026125'
                      description: daily 利息.
                    yearlyInterest:
                      type: string
                      example: '0.0953'
                      description: yearly 利息.
                    borrowLimit:
                      type: string
                      example: '180'
                      description: 借款 限制.
                    marginablePairs:
                      type: array
                      items:
                        type: string
                        example: BNBBTC
                      description: marginable Pairs 列表.
  /sapi/v1/margin/isolated/accountLimit:
    get:
      summary: 查询杠杆逐仓账户启用限制 (USER_DATA)
      description: 查询杠杆逐仓账户启用限制。
      tags:
        - account
      operationId: queryEnabledIsolatedMarginAccountLimit
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-enabled-isolated-margin-account-limit
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryEnabledIsolatedMarginAccountLimit.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_enabled_isolated_margin_account_limit.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_enabled_isolated_margin_account_limit.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryEnabledIsolatedMarginAccountLimitExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryEnabledIsolatedMarginAccountLimit/QueryEnabledIsolatedMarginAccountLimit.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryEnabledIsolatedMarginAccountLimitExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Enabled Isolated 杠杆 账户 限制
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabledAccount:
                    type: integer
                    example: 5
                    format: int64
                    description: 启用 Account.
                  maxAccount:
                    type: integer
                    example: 20
                    format: int64
                    description: 字段说明：max Account.
  /sapi/v1/margin/isolatedMarginData:
    get:
      summary: 获取逐仓杠杆利率及限额 (USER_DATA)
      description: 通过VIP等级或用户当前VIP等级获取逐仓杠杆利率及限额， 如： https://www.binance.com/en/margin-fee
      tags:
        - account
      operationId: queryIsolatedMarginFeeData
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/account#query-isolated-margin-fee-data
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/AccountApi/queryIsolatedMarginFeeData.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/account_api/query_isolated_margin_fee_data.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Account/query_isolated_margin_fee_data.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/account/QueryIsolatedMarginFeeDataExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/AccountAPI/QueryIsolatedMarginFeeData/QueryIsolatedMarginFeeData.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/account/QueryIsolatedMarginFeeDataExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-weight: 1 when a single is specified;(IP) 10 when the symbol parameter is omitted(IP)
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: vipLevel
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: User's 当前 specific 杠杆 数据 will be returned if vipLevel is omitted
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Isolated 杠杆 Fee Data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    vipLevel:
                      type: integer
                      example: 0
                      format: int64
                      description: vip 等级.
                    symbol:
                      type: string
                      example: BTCUSDT
                      description: 交易对.
                    leverage:
                      type: string
                      example: '10'
                      description: 字段说明：leverage.
                    data:
                      type: array
                      items:
                        type: object
                        properties:
                          coin:
                            type: string
                            example: BTC
                            description: 字段说明：coin.
                          dailyInterest:
                            type: string
                            example: '0.00026125'
                            description: daily 利息.
                          borrowLimit:
                            type: string
                            example: '270'
                            description: 借款 限制.
                      description: 数据 列表.
  /sapi/v1/margin/next-hourly-interest-rate:
    get:
      summary: 查询下小时预估利率 (USER_DATA)
      description: 查询用户币种下小时预估利率
      tags:
        - borrow-repay
      operationId: getFutureHourlyInterestRate
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#get-future-hourly-interest-rate
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/getFutureHourlyInterestRate.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/get_future_hourly_interest_rate.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/get_future_hourly_interest_rate.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/GetFutureHourlyInterestRateExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/GetFutureHourlyInterestRate/GetFutureHourlyInterestRate.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/GetFutureHourlyInterestRateExample.php
      x-ip-weight: 100
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: assets
          in: query
          required: true
          schema:
            type: string
            example: BTC,ETH
            description: 资产列表，以逗号分隔，最多20个
        - name: isIsolated
          in: query
          required: true
          schema:
            type: string
            example: 'TRUE'
            enum:
              - 'TRUE'
              - 'FALSE'
            description: 是否逐仓杠杆，
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 获取future hourly 利息 利率
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    asset:
                      type: string
                      example: BTC
                      description: 资产.
                    nextHourlyInterestRate:
                      type: string
                      example: '0.00000571'
                      description: next Hourly Interest 利率.
  /sapi/v1/margin/interestHistory:
    get:
      summary: 获取利息历史 (USER_DATA)
      description: 获取利息历史
      tags:
        - borrow-repay
      operationId: getInterestHistory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#get-interest-history
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/getInterestHistory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/get_interest_history.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/get_interest_history.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/GetInterestHistoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/GetInterestHistory/GetInterestHistory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/GetInterestHistoryExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: false
          schema:
            type: string
            example: USDT
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BNBUSDT
            description: 逐仓交易对，适用于逐仓查询
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
          description: 只支持查询最近90天的数据
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: current
          in: query
          required: false
          schema:
            type: integer
            example: 1
            default: 1
            minimum: 1
            format: int64
            description: 当前查询页。
        - name: size
          in: query
          required: false
          schema:
            type: integer
            example: 10
            default: 10
            maximum: 100
            format: int64
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            description: 赋值不能大于 60000
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 响应返回为降序排列。

        - 如果发送isolatedSymbol，返回指定逐仓symbol的记录。

        - 查询时间范围最大不得超过30天。这是确保数据正确性必须的。

        - 若`startTime`和`endTime`没传，则默认返回最近7天数据

        - 如果`startTime`传递了而`endTime`没传，则返回
        `startTime`到现在的利息历史记录；若`startTime`至今超过30天，则返回过去30天的利息历史记录。

        - 如果`startTime`没传而`endTime`传递了，则返回 `endTime`之前7天的利息历史记录

        - 返回的`type`数据有4种类型:

        - `PERIODIC` 每小时收的利息

        - `ON_BORROW` 借款的时候第一次收的利息

        - `PERIODIC_CONVERTED` 每小时收的利息，用BNB抵扣

        - `ON_BORROW_CONVERTED` 借款的时候第一次收的利息，用BNB抵扣

        - `PORTFOLIO` 统一账户负余额每日利息
      responses:
        '200':
          description: 获取利息 历史
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        txId:
                          type: integer
                          example: 1352286576452864800
                          format: int64
                          description: 字段说明：tx ID.
                        interestAccuredTime:
                          type: integer
                          example: 1672160400000
                          format: int64
                          description: interest Accured 时间.
                        asset:
                          type: string
                          example: USDT
                          description: 资产.
                        rawAsset:
                          type: string
                          example: USDT
                          description: 逐仓不会返回此字段
                        principal:
                          type: string
                          example: '45.3313'
                          description: 本金.
                        interest:
                          type: string
                          example: '0.00024995'
                          description: 利息.
                        interestRate:
                          type: string
                          example: '0.00013233'
                          description: interest 利率.
                        type:
                          type: string
                          example: ON_BORROW
                          description: 类型.
                        isolatedSymbol:
                          type: string
                          example: BNBUSDT
                          description: 返回逐仓symbol; 若是全仓不会返回此字段
                    description: rows 列表.
                  total:
                    type: integer
                    example: 1
                    format: int64
                    description: 总计.
  /sapi/v1/margin/borrow-repay:
    post:
      summary: 杠杆账户借贷/还款 (USER_DATA)
      description: 杠杆账户借贷/还款
      tags:
        - borrow-repay
      operationId: marginAccountBorrowRepay
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#margin-account-borrow-repay
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/marginAccountBorrowRepay.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/margin_account_borrow_repay.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/margin_account_borrow_repay.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/MarginAccountBorrowRepayExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/MarginAccountBorrowRepay/MarginAccountBorrowRepay.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/MarginAccountBorrowRepayExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 1500
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - asset
                - isIsolated
                - amount
                - type
                - timestamp
              properties:
                asset:
                  type: string
                  example: USDT
                isIsolated:
                  type: string
                  example: 'TRUE'
                  description: 是否逐仓杠杆，`TRUE`, `FALSE`, 默认 `FALSE`
                  enum:
                    - 'TRUE'
                    - 'FALSE'
                  default: 'FALSE'
                symbol:
                  type: string
                  example: BTCUSDT
                  description: 逐仓交易对，配合逐仓使用
                amount:
                  type: string
                  example: '1.0'
                type:
                  type: string
                  example: BORROW
                  enum:
                    - BORROW
                    - REPAY
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 borrow/repay
          content:
            application/json:
              schema:
                type: object
                properties:
                  tranId:
                    type: integer
                    example: 100000001
                    format: int64
                    description: 字段说明：tran ID.
    get:
      summary: 查询借贷/还款记录 (USER_DATA)
      description: 查询借贷/还款记录
      tags:
        - borrow-repay
      operationId: queryBorrowRepayRecordsInMarginAccount
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#query-borrow-repay-records-in-margin-account
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/queryBorrowRepayRecordsInMarginAccount.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/query_borrow_repay_records_in_margin_account.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/query_borrow_repay_records_in_margin_account.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/QueryBorrowRepayRecordsInMarginAccountExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/QueryBorrowRepayRecordsInMarginAccount/QueryBorrowRepayRecordsInMarginAccount.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/QueryBorrowRepayRecordsInMarginAccountExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: false
          schema:
            type: string
            example: BNB
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BNBUSDT
            description: 逐仓交易对，适用于逐仓查询
        - name: txId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: '`tranId` in `POST /sapi/v1/杠杆/loan`'
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: current
          in: query
          required: false
          schema:
            type: integer
            example: 1
            default: 1
            minimum: 1
            format: int64
            description: 当前查询页。
        - name: size
          in: query
          required: false
          schema:
            type: integer
            example: 10
            default: 10
            maximum: 100
            format: int64
        - name: type
          in: query
          required: true
          schema:
            type: string
            example: BORROW
            enum:
              - BORROW
              - REPAY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 必须发送`txId`或`startTime`，`txId`优先

        - 响应返回为降序排列。

        -
        传了`asset`参数，最大查询时间范围为`endTime`往前30天；不传`asset`参数，最大查询时间范围为`endTime`往前7天。

        - 若`startTime`和`endTime`没传，则默认返回最近7天数据

        - `startTime`不传，默认`endTime`-7天；结束时间不传，默认当前时间
      responses:
        '200':
          description: borrow/repay records in 杠杆 账户
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          example: AUTO
                          description: 全仓借贷可返回：AUTO,MANUAL ; 全仓还款可返回：MANUAL，AUTO，BNB_AUTO_REPAY，POINT_AUTO_REPAY; 逐仓借贷或还款可返回：AUTO，MANUAL
                        isolatedSymbol:
                          type: string
                          example: BNBUSDT
                          description: 逐仓还款 返回逐仓symbol; 若是全仓不会返回此字段
                        amount:
                          type: string
                          example: '14.00000000'
                          description: 还款总额
                        asset:
                          type: string
                          example: BNB
                          description: 资产.
                        interest:
                          type: string
                          example: '0.01866667'
                          description: 支付的利息
                        principal:
                          type: string
                          example: '13.98133333'
                          description: 支付的本金
                        status:
                          type: string
                          example: CONFIRMED
                          description: '状态: PENDING (等待执行), CONFIRMED (成功还款), FAILED (执行失败);'
                        timestamp:
                          type: integer
                          example: 1563438204000
                          format: int64
                          description: 时间戳.
                        txId:
                          type: integer
                          example: 2970933056
                          format: int64
                          description: 字段说明：tx ID.
                    description: rows 列表.
                  total:
                    type: integer
                    example: 1
                    format: int64
                    description: 总计.
  /sapi/v1/margin/interestRateHistory:
    get:
      summary: 获取杠杆利率历史 (USER_DATA)
      description: 获取杠杆利率历史
      tags:
        - borrow-repay
      operationId: queryMarginInterestRateHistory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#query-margin-interest-rate-history
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/queryMarginInterestRateHistory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/query_margin_interest_rate_history.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/query_margin_interest_rate_history.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/QueryMarginInterestRateHistoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/QueryMarginInterestRateHistory/QueryMarginInterestRateHistory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/QueryMarginInterestRateHistoryExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: true
          schema:
            type: string
            example: BTC
        - name: vipLevel
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: 默认： user's vip level
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
            description: 默认： 7 days ago
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
            description: 默认： present. 最大范围： 1 months.
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 利率 历史
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    asset:
                      type: string
                      example: BTC
                      description: 资产.
                    dailyInterestRate:
                      type: string
                      example: '0.00025000'
                      description: daily Interest 利率.
                    timestamp:
                      type: integer
                      example: 1611544731000
                      format: int64
                      description: 时间戳.
                    vipLevel:
                      type: integer
                      example: 1
                      format: int64
                      description: vip 等级.
  /sapi/v1/margin/maxBorrowable:
    get:
      summary: 查询账户最大可借贷额度 (USER_DATA)
      description: 查询账户最大可借贷额度
      tags:
        - borrow-repay
      operationId: queryMaxBorrow
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/borrow-repay#query-max-borrow
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/BorrowRepayApi/queryMaxBorrow.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/borrow_repay_api/query_max_borrow.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/BorrowRepay/query_max_borrow.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/borrowrepay/QueryMaxBorrowExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/BorrowRepayAPI/QueryMaxBorrow/QueryMaxBorrow.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/borrowrepay/QueryMaxBorrowExample.php
      x-ip-weight: 50
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: true
          schema:
            type: string
            example: BTC
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
            description: 逐仓交易对，适用于逐仓查询
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            maximum: 60000
            format: int64
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: '- `borrowLimit` 的值也可以查看 [https://www.binance.com/cn/margin-fee](https://www.binance.com/cn/margin-fee)'
      responses:
        '200':
          description: 最大 借款
          content:
            application/json:
              schema:
                type: object
                properties:
                  amount:
                    type: string
                    example: '1.69248805'
                    description: 系统可借充足情况下用户账户当前最大可借额度
                  borrowLimit:
                    type: string
                    example: '60'
                    description: 平台限制的用户当前等级可以借的额度
  /sapi/v1/margin/crossMarginCollateralRatio:
    get:
      summary: 全仓币种质押率 (MARKET_DATA)
      description: 全仓币种质押率
      tags:
        - market-data
      operationId: crossMarginCollateralRatio
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#cross-margin-collateral-ratio
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/crossMarginCollateralRatio.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/cross_margin_collateral_ratio.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/cross_margin_collateral_ratio.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/CrossMarginCollateralRatioExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/CrossMarginCollateralRatio/CrossMarginCollateralRatio.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/CrossMarginCollateralRatioExample.php
      x-ip-weight: 100
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: Cross 杠杆 抵押 ratio
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    collaterals:
                      type: array
                      items:
                        type: object
                        properties:
                          minUsdValue:
                            type: string
                            example: '0'
                            description: 字段说明：min Usd Value.
                          maxUsdValue:
                            type: string
                            example: '13000000'
                            description: 字段说明：max Usd Value.
                          discountRate:
                            type: string
                            example: '1'
                            description: discount 利率.
                      description: collaterals 列表.
                    assetNames:
                      type: array
                      items:
                        type: string
                        example: BNX
                      description: 资产 Names 列表.
  /sapi/v1/margin/allPairs:
    get:
      summary: 获取所有全仓杠杆交易对 (MARKET_DATA)
      description: 获取所有全仓杠杆交易对
      tags:
        - market-data
      operationId: getAllCrossMarginPairs
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-all-cross-margin-pairs
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getAllCrossMarginPairs.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_all_cross_margin_pairs.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_all_cross_margin_pairs.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetAllCrossMarginPairsExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetAllCrossMarginPairs/GetAllCrossMarginPairs.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetAllCrossMarginPairsExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BNBBTC
      responses:
        '200':
          description: 获取All Cross 杠杆 Pairs
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    base:
                      type: string
                      example: BNB
                      description: 字段说明：base.
                    id:
                      type: integer
                      example: 351637150141315840
                      format: int64
                      description: 字段说明：ID.
                    isBuyAllowed:
                      type: boolean
                      example: true
                      description: 字段说明：is Buy Allowed.
                    isMarginTrade:
                      type: boolean
                      example: true
                      description: is 杠杆 交易.
                    isSellAllowed:
                      type: boolean
                      example: true
                      description: 字段说明：is Sell Allowed.
                    quote:
                      type: string
                      example: BTC
                      description: 字段说明：quote.
                    symbol:
                      type: string
                      example: BNBBTC
                      description: 交易对.
                    delistTime:
                      type: integer
                      example: 1704973040
                      format: int64
                      description: delist 时间.
  /sapi/v1/margin/isolated/allPairs:
    get:
      summary: 获取所有逐仓杠杆交易对 (MARKET_DATA)
      description: 获取所有逐仓杠杆交易对
      tags:
        - market-data
      operationId: getAllIsolatedMarginSymbol
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-all-isolated-margin-symbol
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getAllIsolatedMarginSymbol.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_all_isolated_margin_symbol.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_all_isolated_margin_symbol.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetAllIsolatedMarginSymbolExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetAllIsolatedMarginSymbol/GetAllIsolatedMarginSymbol.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetAllIsolatedMarginSymbolExample.php
      x-ip-weight: 10
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BNBBTC
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 毫秒时间戳。
      responses:
        '200':
          description: 获取All Isolated 杠杆 交易对
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    base:
                      type: string
                      example: BNB
                      description: 字段说明：base.
                    isBuyAllowed:
                      type: boolean
                      example: true
                      description: 字段说明：is Buy Allowed.
                    isMarginTrade:
                      type: boolean
                      example: true
                      description: is 杠杆 交易.
                    isSellAllowed:
                      type: boolean
                      example: true
                      description: 字段说明：is Sell Allowed.
                    quote:
                      type: string
                      example: BTC
                      description: 字段说明：quote.
                    symbol:
                      type: string
                      example: BNBBTC
                      description: 交易对.
  /sapi/v1/margin/allAssets:
    get:
      summary: 获取所有杠杆资产信息 (MARKET_DATA)
      description: 获取所有杠杆资产信息
      tags:
        - market-data
      operationId: getAllMarginAssets
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-all-margin-assets
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getAllMarginAssets.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_all_margin_assets.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_all_margin_assets.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetAllMarginAssetsExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetAllMarginAssets/GetAllMarginAssets.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetAllMarginAssetsExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: false
          schema:
            type: string
            example: USDC
      responses:
        '200':
          description: 获取All 杠杆 Assets
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    assetFullName:
                      type: string
                      example: USD coin
                      description: 资产 Full Name.
                    assetName:
                      type: string
                      example: USDC
                      description: 资产 Name.
                    isBorrowable:
                      type: boolean
                      example: true
                      description: is 借款able.
                    isMortgageable:
                      type: boolean
                      example: true
                      description: 字段说明：is Mortgageable.
                    userMinBorrow:
                      type: string
                      example: '0.00000000'
                      description: user Min 借款.
                    userMinRepay:
                      type: string
                      example: '0.00000000'
                      description: user Min 还款.
                    delistTime:
                      type: integer
                      example: 1704973040
                      format: int64
                      description: delist 时间.
  /sapi/v1/margin/delist-schedule:
    get:
      summary: 查询下架计划 (MARKET_DATA)
      description: 查询全仓和逐仓的币种或币对的下架计划
      tags:
        - market-data
      operationId: getDelistSchedule
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-delist-schedule
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getDelistSchedule.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_delist_schedule.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_delist_schedule.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetDelistScheduleExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetDelistSchedule/GetDelistSchedule.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetDelistScheduleExample.php
      x-ip-weight: 100
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 毫秒时间戳。
      responses:
        '200':
          description: 获取Delist Schedule
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    delistTime:
                      type: integer
                      example: 1686161202000
                      format: int64
                      description: delist 时间.
                    crossMarginAssets:
                      type: array
                      items:
                        type: string
                        example: BTC
                      description: 全仓 杠杆 Assets 列表.
                    isolatedMarginSymbols:
                      type: array
                      items:
                        type: string
                        example: ADAUSDT
                      description: 逐仓 杠杆 Symbols 列表.
  /sapi/v1/margin/limit-price-pairs:
    get:
      summary: 查询出价限定的交易对 (MARKET_DATA)
      description: |-
        查询所有对于高买低卖的限价单施加了价格区间限制的出价限定的交易对。

        在杠杆交易中，用户可以设置限价委托单。对于杠杆交易对，限价应在当前指数价格的(-15%,
        15%)范围内。此规则仅适用于低于当前指数价格的限价卖出价和高于当前指数价格的限价买入价。


        - 买入订单：如果限价高于指数价格的15%，您的委托将被拒绝，并显示错误消息。

        - 卖出订单：如果限价低于指数价格的15%，您的委托将被拒绝，并显示错误消息。

        请优化修改限价委托策略，并根据交易量和订单簿深度回测和校准计划的限价委托数量规模，以防止交易亏损。
      tags:
        - market-data
      operationId: getLimitPricePairs
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-limit-price-pairs
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getLimitPricePairs.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_limit_price_pairs.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_limit_price_pairs.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetLimitPricePairs/GetLimitPricePairs.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetLimitPricePairsExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: 获取限制 价格 Pairs
          content:
            application/json:
              schema:
                type: object
                properties:
                  crossMarginSymbols:
                    type: array
                    items:
                      type: string
                      example: BLURUSDC
                    description: 全仓 杠杆 Symbols 列表.
  /sapi/v1/margin/list-schedule:
    get:
      summary: 查询上架计划 (MARKET_DATA)
      description: 查询全仓和逐仓的币种或币对的上架计划
      tags:
        - market-data
      operationId: getListSchedule
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-list-schedule
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getListSchedule.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_list_schedule.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_list_schedule.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetListScheduleExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetListSchedule/GetListSchedule.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetListScheduleExample.php
      x-ip-weight: 100
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 毫秒时间戳。
      responses:
        '200':
          description: 获取列表 Schedule
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    listTime:
                      type: integer
                      example: 1686161202000
                      format: int64
                      description: 列表 时间.
                    crossMarginAssets:
                      type: array
                      items:
                        type: string
                        example: BTC
                      description: 全仓 杠杆 Assets 列表.
                    isolatedMarginSymbols:
                      type: array
                      items:
                        type: string
                        example: ADAUSDT
                      description: 逐仓 杠杆 Symbols 列表.
  /sapi/v1/margin/risk-based-liquidation-ratio:
    get:
      summary: 获取杠杆资产风险强制平仓率 (MARKET_DATA)
      description: 获取杠杆资产风险强制平仓率
      tags:
        - market-data
      operationId: getMarginAssetRiskBasedLiquidationRatio
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-margin-asset-risk-based-liquidation-ratio
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getMarginAssetRiskBasedLiquidationRatio.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_margin_asset_risk_based_liquidation_ratio.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_margin_asset_risk_based_liquidation_ratio.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetMarginAssetRiskBasedLiquidationRatio/GetMarginAssetRiskBasedLiquidationRatio.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: 获取杠杆 资产 Risk-Based Liquidation Ratio
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    asset:
                      type: string
                      example: USDC
                      description: 资产.
                    riskBasedLiquidationRatio:
                      type: string
                      example: '0.01'
                      description: 字段说明：risk Based LiquIDation Ratio.
  /sapi/v1/margin/restricted-asset:
    get:
      summary: 获取杠杆受限资产清单 (MARKET_DATA)
      description: 获取杠杆受限资产清单
      tags:
        - market-data
      operationId: getMarginRestrictedAssets
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#get-margin-restricted-assets
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/getMarginRestrictedAssets.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/get_margin_restricted_assets.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/get_margin_restricted_assets.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/GetMarginRestrictedAssets/GetMarginRestrictedAssets.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/GetMarginRestrictedAssetsExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: 获取杠杆 Restricted Assets
          content:
            application/json:
              schema:
                type: object
                properties:
                  openLongRestrictedAsset:
                    type: array
                    items:
                      type: string
                      example: ADA
                    description: open Long Restricted 资产 列表.
                  maxCollateralExceededAsset:
                    type: array
                    items:
                      type: string
                      example: ACH
                    description: max Collateral Exceeded 资产 列表.
  /sapi/v1/margin/isolatedMarginTier:
    get:
      summary: 获取逐仓档位信息 (USER_DATA)
      description: 通过档位获取逐仓杠杆档位数据， 如： https://www.binance.com/en/margin-data
      tags:
        - market-data
      operationId: queryIsolatedMarginTierData
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#query-isolated-margin-tier-data
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/queryIsolatedMarginTierData.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/query_isolated_margin_tier_data.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/query_isolated_margin_tier_data.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryIsolatedMarginTierDataExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/QueryIsolatedMarginTierData/QueryIsolatedMarginTierData.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/QueryIsolatedMarginTierDataExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTCUSDT
        - name: tier
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: 不传则返回所有逐仓杠杆档位
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Isolated 杠杆 Tier Data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                      example: BTCUSDT
                      description: 交易对.
                    tier:
                      type: integer
                      example: 1
                      format: int64
                      description: 字段说明：tier.
                    effectiveMultiple:
                      type: string
                      example: '10'
                      description: 字段说明：effective Multiple.
                    initialRiskRatio:
                      type: string
                      example: '1.111'
                      description: 字段说明：initial Risk Ratio.
                    liquidationRiskRatio:
                      type: string
                      example: '1.05'
                      description: 字段说明：liquIDation Risk Ratio.
                    baseAssetMaxBorrowable:
                      type: string
                      example: '9'
                      description: base 资产 Max Borrowable.
                    quoteAssetMaxBorrowable:
                      type: string
                      example: '70000'
                      description: quote 资产 Max Borrowable.
  /sapi/v1/margin/leverageBracket:
    get:
      summary: 查询全仓杠杆Pro模式下的负债币种杠杆与保证金率 (MARKET_DATA)
      description: 查询全仓杠杆Pro模式下的负债币种杠杆与保证金率
      tags:
        - market-data
      operationId: queryLiabilityCoinLeverageBracketInCrossMarginProMode
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#query-liability-coin-leverage-bracket-in-cross-margin-pro-mode
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/queryLiabilityCoinLeverageBracketInCrossMarginProMode.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/query_liability_coin_leverage_bracket_in_cross_margin_pro_mode.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/query_liability_coin_leverage_bracket_in_cross_margin_pro_mode.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryLiabilityCoinLeverageBracketInCrossMarginProModeExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/QueryLiabilityCoinLeverageBracketInCrossMarginProMode/QueryLiabilityCoinLeverageBracketInCrossMarginProMode.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/QueryLiabilityCoinLeverageBracketInCrossMarginProModeExample.php
      x-ip-weight: 1
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: Liability Coin Leverage Bracket in Cross 杠杆 Pro Mode
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    assetNames:
                      type: array
                      items:
                        type: string
                        example: SHIB
                      description: 资产 Names 列表.
                    rank:
                      type: integer
                      example: 1
                      format: int64
                      description: 字段说明：rank.
                    brackets:
                      type: array
                      items:
                        type: object
                        properties:
                          leverage:
                            type: integer
                            example: 10
                            format: int64
                            description: 字段说明：leverage.
                          maxDebt:
                            type: number
                            example: 1000000
                            format: float
                            description: 字段说明：max Debt.
                          maintenanceMarginRate:
                            type: number
                            example: 0.02
                            format: float
                            description: maintenance 杠杆 利率.
                          initialMarginRate:
                            type: number
                            example: 0.1112
                            format: float
                            description: initial 杠杆 利率.
                          fastNum:
                            type: number
                            example: 60000
                            format: float
                            description: 字段说明：fast Num.
                      description: brackets 列表.
  /sapi/v1/margin/available-inventory:
    get:
      summary: 杠杆可用放贷库存查询 (USER_DATA)
      description: 杠杆可用放贷库存查询
      tags:
        - market-data
      operationId: queryMarginAvailableInventory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#query-margin-available-inventory
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/queryMarginAvailableInventory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/query_margin_available_inventory.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/query_margin_available_inventory.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryMarginAvailableInventoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/QueryMarginAvailableInventory/QueryMarginAvailableInventory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/QueryMarginAvailableInventoryExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 50
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: type
          in: query
          required: true
          schema:
            type: string
            example: MARGIN
            enum:
              - MARGIN
              - ISOLATED
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 Available Inventory
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: object
                    description: 每个资产的可用库存。键为资产符号，值为可用数量。
                    additionalProperties:
                      type: string
                    example:
                      MATIC: '200'
                      STPT: '30000'
                      TVK: '10000'
                      SHIB: '4000000'
                  updateTime:
                    type: integer
                    example: 1699272487
                    format: int64
                    description: update 时间.
  /sapi/v1/margin/priceIndex:
    get:
      summary: 查询杠杆价格指数 (MARKET_DATA)
      description: 查询杠杆价格指数
      tags:
        - market-data
      operationId: queryMarginPriceindex
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/market-data#query-margin-priceindex
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/MarketDataApi/queryMarginPriceindex.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/market_data_api/query_margin_priceindex.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/MarketData/query_margin_priceindex.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryMarginPriceindexExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/MarketDataAPI/QueryMarginPriceindex/QueryMarginPriceindex.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/marketdata/QueryMarginPriceindexExample.php
      x-ip-weight: 10
      x-security-type: MARKET_DATA
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BNBBTC
      responses:
        '200':
          description: 杠杆 价格Index
          content:
            application/json:
              schema:
                type: object
                properties:
                  calcTime:
                    type: integer
                    example: 1562046418000
                    format: int64
                    description: calc 时间.
                  price:
                    type: string
                    example: '0.00333930'
                    description: 价格.
                  symbol:
                    type: string
                    example: BNBBTC
                    description: 交易对.
  /sapi/v1/margin/listen-key:
    delete:
      summary: 关闭listenKey (USER_STREAM)
      description: 关闭某账户数据流
      tags:
        - user-data-stream
      operationId: closeUserDataStream
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/user-data-stream#close-user-data-stream
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/UserDataStreamApi/closeUserDataStream.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/user_data_stream_api/close_user_data_stream.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/UserDataStream/close_user_data_stream.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/userdatastream/CloseUserDataStreamExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/UserDataStreamAPI/CloseUserDataStream/CloseUserDataStream.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/userdatastream/CloseUserDataStreamExample.php
      x-security-type: USER_STREAM
      x-uid-weight: 3000
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: 成功
    put:
      summary: 延长listenKey有效期 (USER_STREAM)
      description: 有效期延长至本次调用后24小时。
      tags:
        - user-data-stream
      operationId: keepaliveUserDataStream
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/user-data-stream#keepalive-user-data-stream
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/UserDataStreamApi/keepaliveUserDataStream.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/user_data_stream_api/keepalive_user_data_stream.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/UserDataStream/keepalive_user_data_stream.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/userdatastream/KeepaliveUserDataStreamExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/UserDataStreamAPI/KeepaliveUserDataStream/KeepaliveUserDataStream.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/userdatastream/KeepaliveUserDataStreamExample.php
      x-security-type: USER_STREAM
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - listenKey
              properties:
                listenKey:
                  type: string
                  example: null
      responses:
        '200':
          description: 成功
    post:
      summary: 生成listenKey (USER_STREAM)
      description: 创建一个新的user data stream，返回值为一个listenKey
      tags:
        - user-data-stream
      operationId: startUserDataStream
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/user-data-stream#start-user-data-stream
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/UserDataStreamApi/startUserDataStream.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/user_data_stream_api/start_user_data_stream.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/UserDataStream/start_user_data_stream.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/userdatastream/StartUserDataStreamExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/UserDataStreamAPI/StartUserDataStream/StartUserDataStream.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/userdatastream/StartUserDataStreamExample.php
      x-security-type: USER_STREAM
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      responses:
        '200':
          description: 开始 用户 Data Stream
          content:
            application/json:
              schema:
                type: object
                properties:
                  listenKey:
                    type: string
                    example: T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhd
                    description: 列表en 密钥.
  /sapi/v1/margin/apiKey:
    post:
      summary: 新建低延迟交易SpecialKey (TRADE)
      description: |-
        **资格要求**

        - 杠杆交易为VIP7及以上的用户提供了低延迟交易接口，这类接口通过特定的[SpecialKey](https://www.binance.com/zh-CN/support/faq/%E5%B8%81%E5%AE%89%E6%9D%A0%E6%9D%86-margin-special-key-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98-3208663e900d4d2e9fec4140e1832f4e)实现杠杆交易。
        - 若您的VIP级别为6及以下，请联系您的VIP经理获取相关SpecialKey的使用许可标准。
        - 所有新的 Margin Special Key 用户在创建 Margin Special Key 之前，必须在主账户层级阅读、理解并同意《Margin Special Key 补充产品条款》。
        - 主账户签署后，该协议适用于所有子账户。主账户及所有子账户（全仓杠杆经典模式和统一账户Pro模式）均有权创建 Margin Special Key，并受 LiquidationLoan 政策约束。

        更多信息请参考 [FAQ](https://www.binance.com/zh-CN/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e)。

        **该接口支持以下产品：**

        * 全仓杠杆
        * 逐仓杠杆
        * 统一账户Pro模式

        **该接口不支持以下产品：**

        * 统一账户普通模式

        我们提供以下3类接口：

        * Ed25519 (recommended)
        * HMAC
        * RSA

        这3类接口中，我们推荐用户使用**use Ed25519 API keys**，它具有最高的性能和安全系数。

        我们接受PKCS#8 (BEGIN PUBLIC KEY). 关于如何生成RSA密钥对发送API请求，请参考 [FAQ](https://www.binance.com/zh-TC/support/faq/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%B9%A3%E5%AE%89%E4%B8%8A%E7%94%9F%E6%88%90-rsa-%E9%87%91%E9%91%B0%E5%B0%8D%E4%B8%A6%E7%99%BC%E9%80%81-api-%E8%AB%8B%E6%B1%82-2b79728f331e43079b27440d9d15c5db) 。

        **如何使用杠杆专用密钥**
        - 使用以下 `sapi` 接口创建您的杠杆专用 SpecialKey。
        - 关于访问全仓杠杆账户，请勿发送 `symbol` 参数。
        - 关于访问逐仓杠杆账户，请在创建 SpecialKey 的请求中传入相关的 `symbol` 参数。
        - 使用生成的 SpecialKey（以及对应的 Secret key，如适用）通过 **现货** REST API (`https://api.binance.com/api/v3/*`) 端点执行杠杆交易和 listenKey 生成操作。

        关于如何使用其他API，请参考[REST API](/products/spot/rest-api#signed-trade-and-user_data-endpoint-security) 或 [WebSocket API](/products/spot/web-socket-api#request-security) 。

        您需要为special key开通"允许现货及杠杆交易"权限才能调用此接口。
      tags:
        - trade
      operationId: createSpecialKey
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#create-special-key
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/createSpecialKey.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/create_special_key.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/create_special_key.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/CreateSpecialKey/CreateSpecialKey.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/CreateSpecialKeyExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - apiName
                - timestamp
              properties:
                apiName:
                  type: string
                  example: apiName
                symbol:
                  type: string
                  example: BTCUSDT
                ip:
                  type: string
                  example: 69.210.67.14,69.210.67.15
                  description: Can be added in batches, separated by commas. 最大 30 用于 an API Key
                publicKey:
                  type: string
                  example: publicKey
                  description: 1. If public密钥 is inputted it will create an RSA or Ed25519 密钥. 2. Need to be encoded to URL-encoded format
                permissionMode:
                  type: string
                  example: READ
                  default: TRADE
                  enum:
                    - TRADE
                    - READ
                  description: This parameter is only for the Ed25519 API key, and does not effact for other encryption methods. The value can be 交易 (交易 for all permissions) or READ (READ for USER_DATA, FIX_API_READ_ONLY). The 默认 value is 交易.
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-response-notes: |-
        - 常见错误代码
        - **UNSUPPORTED_OPERATION** : 该接口不支持统一账户普通模式，请转换账户类型到支持该接口的产品模式。
        - **Forbidden**: 全仓Pro模式需要签订额外的协议，请联系您的VIP经历获得相应支持。
      responses:
        '200':
          description: 创建Special Key
          content:
            application/json:
              schema:
                type: object
                properties:
                  apiKey:
                    type: string
                    example: npOzOAeLVgr2TuxWfNo43AaPWpBbJEoKezh1o8mSQb6ryE2odE11A4AoVlJbQoGx
                    description: API密钥.
                  secretKey:
                    type: string
                    example: 87ssWB7azoy6ACRfyp6OVOL5U3rtZptX31QWw2kWjl1jHEYRbyM1pd6qykRBQw8p
                    description: secret密钥 will be null when creating an RSA 密钥
                  type:
                    type: string
                    example: HMAC_SHA256
                    description: 字段说明：HMAC_SHA256 or RSA
    delete:
      summary: 删除Special Key(Low-Latency Trading) (TRADE)
      description: |-
        仅删除您的 Margin Special Key 并不代表您退出 Margin Special Key 框架，也不解除您在《Margin Special Key 补充产品条款》下的相关义务。如需完全退出，您必须完成以下步骤：

        1. 删除您的 Margin Special Key。
        2. 确保账户中没有未结清的负债。
        3. 调用”退出 Margin Special Key”API 接口。
        4. 通过 API 响应确认退出状态。

        只有在第 4 步完成且退出状态经 Binance 通过 API 确认后，您的账户才会恢复标准强平逻辑，并不再受《Margin Special Key 补充产品条款》的约束。

        如果提供了apiKey参数，则apiName将会被忽略；如果只提供了apiName而没有apiKey，则以apiName为命名的所有apiKey都会被删除。

        您需要为special key开通”允许现货及杠杆交易”权限才能调用此接口。
      tags:
        - trade
      operationId: deleteSpecialKey
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#delete-special-key
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/deleteSpecialKey.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/delete_special_key.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/delete_special_key.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/DeleteSpecialKeyExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/DeleteSpecialKey/DeleteSpecialKey.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/DeleteSpecialKeyExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: apiKey
          in: query
          required: false
          schema:
            type: string
            example: apiKey
        - name: apiName
          in: query
          required: false
          schema:
            type: string
            example: apiName
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
            description: 逐仓 杠杆 pair
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 成功
    get:
      summary: 查询低延迟交易SpecialKey (TRADE)
      description: 查询SpecialKey信息，仅适用于低延迟交易接口的SpecialKey。
      tags:
        - trade
      operationId: querySpecialKey
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-special-key
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/querySpecialKey.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_special_key.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_special_key.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QuerySpecialKeyExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QuerySpecialKey/QuerySpecialKey.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QuerySpecialKeyExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: apiKey
          in: query
          required: true
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 专用 密钥
          content:
            application/json:
              schema:
                type: object
                properties:
                  apiKey:
                    type: string
                    example: npOzOAeLVgr2TuxWfNo43AaPWpBbJEoKezh1o8mSQb6ryE2odE11A4AoVlJbQoGx
                    description: API密钥.
                  ip:
                    type: string
                    example: 0.0.0.0,192.168.0.1,192.168.0.2
                    description: 字段说明：0.0.0.0 is just an initial statereference (no extra meaning).
                  apiName:
                    type: string
                    example: testName
                    description: 字段说明：api Name.
                  type:
                    type: string
                    example: RSA
                    description: 类型.
                  permissionMode:
                    type: string
                    example: TRADE
                    description: permission 模式.
  /sapi/v1/margin/apiKey/ip:
    put:
      summary: 修改可供SpecialKey执行的IP地址 (TRADE)
      description: |-
        修改可供低延迟交易的SpecialKey执行的IP地址, 仅适用低延迟交易SpecialKey。

        该接口需开通“Enable Spot & Margin”的权限。
      tags:
        - trade
      operationId: editIpForSpecialKey
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#edit-ip-for-special-key
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/editIpForSpecialKey.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/edit_ip_for_special_key.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/edit_ip_for_special_key.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/EditIpForSpecialKeyExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/EditIpForSpecialKey/EditIpForSpecialKey.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/EditIpForSpecialKeyExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - apiKey
                - ip
                - timestamp
              properties:
                apiKey:
                  type: string
                  example: apiKey
                symbol:
                  type: string
                  example: BTCUSDT
                  description: isolated 杠杆 pair
                ip:
                  type: string
                  example: 24.156.99.202
                  description: Can be added in batches, separated by commas. Max 30 for an API密钥
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 成功
  /sapi/v1/margin/exit-special-key-mode:
    post:
      summary: 退出Special Key模式 (TRADE)
      description: |-
        退出全仓杠杆账户经典模式的 Margin Special Key 模式。

        **调用本接口前，须确保全仓杠杆账户经典模式下负债已全额还清。**请注意，仅删除 Margin Special Key 并不构成有效退出。

        当用户创建 Margin Special Key 后，账户即进入"Margin Special Key 模式"。此接口请求成功后，将自动执行以下操作：

        1. 全仓杠杆账户经典模式下的所有 Margin Special Key 将被删除。
        2. 所有操作前的保证金检查（包括开仓亏损计算）将恢复为标准模式。
        3. 将执行冷却期（默认：24 小时），冷却期内账户不得创建新的 Margin Special Key。

        更多信息请参考 [FAQ](https://www.binance.com/zh-CN/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e)。

        **前置条件：**

        请求需满足以下条件，否则将被拒绝：

        - 账户类型必须为**全仓经典(Cross Margin Classic)**。
        - 账户必须当前处于 **Special Key 模式**。如不在该模式下，请求将静默成功。
        - 账户**不能处于强制平仓中**。
        - 账户**不能有负债**。

        您需要为请求此接口的 API key 启用"允许现货及杠杆交易"权限。
      tags:
        - trade
      operationId: exitSpecialKeyMode
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#exit-special-key-mode
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/exitSpecialKeyMode.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/exit_special_key_mode.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/exit_special_key_mode.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/ExitSpecialKeyModeExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/ExitSpecialKeyMode/ExitSpecialKeyMode.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/ExitSpecialKeyModeExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 10
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - timestamp
              properties:
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                  description: 赋值不能大于 `60000`
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 退出Special Key模式
          content:
            application/json:
              schema:
                type: object
  /sapi/v1/margin/forceLiquidationRec:
    get:
      summary: 获取账户强制平仓记录 (USER_DATA)
      description: 获取账户强制平仓记录
      tags:
        - trade
      operationId: getForceLiquidationRecord
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-force-liquidation-record
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/getForceLiquidationRecord.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/get_force_liquidation_record.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/get_force_liquidation_record.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/GetForceLiquidationRecordExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/GetForceLiquidationRecord/GetForceLiquidationRecord.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/GetForceLiquidationRecordExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
        - name: current
          in: query
          required: false
          schema:
            type: integer
            example: 1
            default: 1
            minimum: 1
            format: int64
            description: 当前查询页。
        - name: size
          in: query
          required: false
          schema:
            type: integer
            example: 10
            format: int64
            maximum: 100
            default: 10
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: '- 响应返回为降序排列。'
      responses:
        '200':
          description: 获取Force Liquidation Record
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        avgPrice:
                          type: string
                          example: '0.00388359'
                          description: avg 价格.
                        executedQty:
                          type: string
                          example: '31.39000000'
                          description: executed 数量.
                        orderId:
                          type: integer
                          example: 180015097
                          format: int64
                          description: 订单 ID.
                        price:
                          type: string
                          example: '0.00388110'
                          description: 价格.
                        qty:
                          type: string
                          example: '31.39000000'
                          description: 数量.
                        side:
                          type: string
                          example: SELL
                          description: 方向.
                        symbol:
                          type: string
                          example: BNBBTC
                          description: 交易对.
                        timeInForce:
                          type: string
                          example: GTC
                          description: 时间 In Force.
                        isIsolated:
                          type: boolean
                          example: true
                          description: is 逐仓.
                        updatedTime:
                          type: integer
                          example: 1558941374745
                          format: int64
                          description: updated 时间.
                    description: rows 列表.
                  total:
                    type: integer
                    example: 1
                    format: int64
                    description: 总计.
  /sapi/v1/margin/exchange-small-liability:
    get:
      summary: 查询可小额负债转换的资产 (USER_DATA)
      description: 查询可小额负债转换的币种
      tags:
        - trade
      operationId: getSmallLiabilityExchangeCoinList
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-small-liability-exchange-coin-list
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/getSmallLiabilityExchangeCoinList.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/get_small_liability_exchange_coin_list.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/get_small_liability_exchange_coin_list.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/GetSmallLiabilityExchangeCoinListExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/GetSmallLiabilityExchangeCoinList/GetSmallLiabilityExchangeCoinList.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/GetSmallLiabilityExchangeCoinListExample.php
      x-ip-weight: 100
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 获取Small Liability Exchange Coin 列表
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    asset:
                      type: string
                      example: ETH
                      description: 资产.
                    interest:
                      type: string
                      example: '0.00083334'
                      description: 利息.
                    principal:
                      type: string
                      example: '0.001'
                      description: 本金.
                    liabilityAsset:
                      type: string
                      example: USDT
                      description: liability 资产.
                    liabilityQty:
                      type: number
                      example: 0.3552
                      format: float
                      description: liability 数量.
    post:
      summary: 全仓杠杆小额负债转换 (MARGIN)
      description: 全仓杠杆小额负债转换
      tags:
        - trade
      operationId: smallLiabilityExchange
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#small-liability-exchange
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/smallLiabilityExchange.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/small_liability_exchange.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/small_liability_exchange.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/SmallLiabilityExchangeExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/SmallLiabilityExchange/SmallLiabilityExchange.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/SmallLiabilityExchangeExample.php
      x-security-type: MARGIN
      x-signed: true
      x-uid-weight: 3000
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: |-
        - 兑换请求限流6小时一次
        - 币种负债小于10USDT
        - 币种数量最大10个
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - assetNames
                - timestamp
              properties:
                assetNames:
                  type: string
                  example: BTC,ETH
                  description: 小额转换的资产列表
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 成功
  /sapi/v1/margin/exchange-small-liability-history:
    get:
      summary: 查询全仓杠杆小额负债转换历史 (USER_DATA)
      description: 查询全仓杠杆小额负债转换历史
      tags:
        - trade
      operationId: getSmallLiabilityExchangeHistory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-small-liability-exchange-history
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/getSmallLiabilityExchangeHistory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/get_small_liability_exchange_history.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/get_small_liability_exchange_history.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/GetSmallLiabilityExchangeHistoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/GetSmallLiabilityExchangeHistory/GetSmallLiabilityExchangeHistory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/GetSmallLiabilityExchangeHistoryExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 100
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: current
          in: query
          required: true
          schema:
            type: integer
            example: 1
            default: 1
            minimum: 1
            format: int64
            description: 当前页面，
        - name: size
          in: query
          required: true
          schema:
            type: integer
            example: 10
            format: int64
            maximum: 100
            default: 10
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
            description: 默认： 30 days from 当前 时间戳
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
            description: 默认： present 时间戳
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 获取Small Liability Exchange 历史
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    example: 1
                    format: int64
                    description: 总计.
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        asset:
                          type: string
                          example: ETH
                          description: 资产.
                        amount:
                          type: string
                          example: '0.00083434'
                          description: 数量.
                        targetAsset:
                          type: string
                          example: BUSD
                          description: target 资产.
                        targetAmount:
                          type: string
                          example: '1.37576819'
                          description: target 数量.
                        bizType:
                          type: string
                          example: EXCHANGE_SMALL_LIABILITY
                          description: biz 类型.
                        timestamp:
                          type: integer
                          example: 1672801339253
                          format: int64
                          description: 时间戳.
                    description: rows 列表.
  /sapi/v1/margin/openOrders:
    delete:
      summary: 杠杆账户撤销单一交易对的所有挂单 (TRADE)
      description: 杠杆账户撤销单一交易对下所有挂单, 包括OCO的挂单。
      tags:
        - trade
      operationId: marginAccountCancelAllOpenOrdersOnASymbol
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-all-open-orders-on-asymbol
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountCancelAllOpenOrdersOnASymbol.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_cancel_all_open_orders_on_a_symbol.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_cancel_all_open_orders_on_a_symbol.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountCancelAllOpenOrdersOnASymbolExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountCancelAllOpenOrdersOnASymbol/MarginAccountCancelAllOpenOrdersOnASymbol.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountCancelAllOpenOrdersOnASymbolExample.php
      x-ip-weight: 1
      x-security-type: TRADE
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTCUSDT
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 取消all 未完成订单 on a 交易对
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                      example: BTCUSDT
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: true
                      description: 是否是逐仓symbol交易
                    origClientOrderId:
                      type: string
                      example: E6APeyTJvkMvLMYMqu1KQ4
                      description: orig 客户端 订单 ID.
                    orderId:
                      type: integer
                      example: 11
                      format: int64
                      description: 订单 ID.
                    orderListId:
                      type: integer
                      example: -1
                      format: int64
                      description: 订单 列表 ID.
                    clientOrderId:
                      type: string
                      example: pXLV6Hz6mprAcVYpVMTGgx
                      description: 客户端 订单 ID.
                    price:
                      type: string
                      example: '0.089853'
                      description: 价格.
                    origQty:
                      type: string
                      example: '0.178622'
                      description: orig 数量.
                    executedQty:
                      type: string
                      example: '0.000000'
                      description: executed 数量.
                    cummulativeQuoteQty:
                      type: string
                      example: '0.000000'
                      description: cummulative Quote 数量.
                    status:
                      type: string
                      example: CANCELED
                      description: 状态.
                    timeInForce:
                      type: string
                      example: GTC
                      description: 时间 In Force.
                    type:
                      type: string
                      example: LIMIT
                      description: 类型.
                    side:
                      type: string
                      example: BUY
                      description: 方向.
                    selfTradePreventionMode:
                      type: string
                      example: NONE
                      description: self 交易 Prevention Mode.
                    contingencyType:
                      type: string
                      example: OCO
                      description: contingency 类型.
                    listStatusType:
                      type: string
                      example: ALL_DONE
                      description: 列表 状态 类型.
                    listOrderStatus:
                      type: string
                      example: ALL_DONE
                      description: 列表 订单 状态.
                    listClientOrderId:
                      type: string
                      example: 2inzWQdDvZLHbbAmAozX2N
                      description: 列表 客户端 订单 ID.
                    transactionTime:
                      type: integer
                      example: 1585230948299
                      format: int64
                      description: transaction 时间.
                    orders:
                      type: array
                      items:
                        type: object
                        properties:
                          symbol:
                            type: string
                            example: BTCUSDT
                            description: 交易对.
                          orderId:
                            type: integer
                            example: 20
                            format: int64
                            description: 订单 ID.
                          clientOrderId:
                            type: string
                            example: CwOOIPHSmYywx6jZX77TdL
                            description: 客户端 订单 ID.
                      description: 订单 列表.
                    orderReports:
                      type: array
                      items:
                        type: object
                        properties:
                          symbol:
                            type: string
                            example: BTCUSDT
                            description: 交易对.
                          origClientOrderId:
                            type: string
                            example: CwOOIPHSmYywx6jZX77TdL
                            description: orig 客户端 订单 ID.
                          orderId:
                            type: integer
                            example: 20
                            format: int64
                            description: 订单 ID.
                          orderListId:
                            type: integer
                            example: 1929
                            format: int64
                            description: 订单 列表 ID.
                          clientOrderId:
                            type: string
                            example: pXLV6Hz6mprAcVYpVMTGgx
                            description: 客户端 订单 ID.
                          price:
                            type: string
                            example: '0.668611'
                            description: 价格.
                          origQty:
                            type: string
                            example: '0.690354'
                            description: orig 数量.
                          executedQty:
                            type: string
                            example: '0.000000'
                            description: executed 数量.
                          cummulativeQuoteQty:
                            type: string
                            example: '0.000000'
                            description: cummulative Quote 数量.
                          status:
                            type: string
                            example: CANCELED
                            description: 状态.
                          timeInForce:
                            type: string
                            example: GTC
                            description: 时间 In Force.
                          type:
                            type: string
                            example: STOP_LOSS_LIMIT
                            description: 类型.
                          side:
                            type: string
                            example: BUY
                            description: 方向.
                          stopPrice:
                            type: string
                            example: '0.378131'
                            description: stop 价格.
                          icebergQty:
                            type: string
                            example: '0.017083'
                            description: iceberg 数量.
                      description: 订单 Reports 列表.
    get:
      summary: 查询杠杆账户挂单记录 (USER_DATA)
      description: 查询杠杆账户挂单记录
      tags:
        - trade
      operationId: queryMarginAccountsOpenOrders
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-orders
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsOpenOrders.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_open_orders.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_open_orders.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsOpenOrdersExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsOpenOrders/QueryMarginAccountsOpenOrders.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsOpenOrdersExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BNBBTC
          description: isolated 杠杆 pair
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 如未发送symbol，返回所有 symbols 订单记录。
        - 当返回所有symbols时，针对限速器计数的请求数量等于当前在交易所交易的symbols数量。
        - 如果 isIsolated = "TRUE", symbol 为必填'
      responses:
        '200':
          description: 杠杆 账户's 未完成订单
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    clientOrderId:
                      type: string
                      example: qhcZw71gAkCCTv0t0k8LUK
                      description: 客户端 订单 ID.
                    cummulativeQuoteQty:
                      type: string
                      example: '0.00000000'
                      description: cummulative Quote 数量.
                    executedQty:
                      type: string
                      example: '0.00000000'
                      description: executed 数量.
                    icebergQty:
                      type: string
                      example: '0.00000000'
                      description: iceberg 数量.
                    isWorking:
                      type: boolean
                      example: true
                      description: 字段说明：is Working.
                    orderId:
                      type: integer
                      example: 211842552
                      format: int64
                      description: 订单 ID.
                    origQty:
                      type: string
                      example: '0.30000000'
                      description: orig 数量.
                    price:
                      type: string
                      example: '0.00475010'
                      description: 价格.
                    side:
                      type: string
                      example: SELL
                      description: 方向.
                    status:
                      type: string
                      example: NEW
                      description: 状态.
                    stopPrice:
                      type: string
                      example: '0.00000000'
                      description: stop 价格.
                    symbol:
                      type: string
                      example: BNBBTC
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: true
                      description: 是否是逐仓symbol交易
                    time:
                      type: integer
                      example: 1562040170089
                      format: int64
                      description: 时间.
                    timeInForce:
                      type: string
                      example: GTC
                      description: 时间 In Force.
                    type:
                      type: string
                      example: LIMIT
                      description: 类型.
                    selfTradePreventionMode:
                      type: string
                      example: NONE
                      description: self 交易 Prevention Mode.
                    updateTime:
                      type: integer
                      example: 1562040170089
                      format: int64
                      description: update 时间.
  /sapi/v1/margin/orderList:
    delete:
      summary: 取消杠杆账户 OCO 订单 (TRADE)
      description: 取消杠杆账户订单列表。
      tags:
        - trade
      operationId: marginAccountCancelOco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-oco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountCancelOco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_cancel_oco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_cancel_oco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountCancelOcoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountCancelOco/MarginAccountCancelOco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountCancelOcoExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTCUSDT
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: orderListId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: '`orderListId` 或 `listClientOrderId` 必须被提供'
        - name: listClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
            description: '`orderListId` 或 `listClientOrderId` 必须被提供'
        - name: newClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
            description: 用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: '- 请参见英文说明。'
      responses:
        '200':
          description: 杠杆 账户 取消OCO
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderListId:
                    type: integer
                    example: 0
                    format: int64
                    description: 订单 列表 ID.
                  contingencyType:
                    type: string
                    example: OCO
                    description: contingency 类型.
                  listStatusType:
                    type: string
                    example: ALL_DONE
                    description: 列表 状态 类型.
                  listOrderStatus:
                    type: string
                    example: ALL_DONE
                    description: 列表 订单 状态.
                  listClientOrderId:
                    type: string
                    example: C3wyj4WVEktd7u9aVBRXcN
                    description: 列表 客户端 订单 ID.
                  transactionTime:
                    type: integer
                    example: 1574040868128
                    format: int64
                    description: transaction 时间.
                  symbol:
                    type: string
                    example: LTCBTC
                    description: 交易对.
                  isIsolated:
                    type: boolean
                    example: false
                    description: 是否是逐仓symbol交易
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: LTCBTC
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 2
                          format: int64
                          description: 订单 ID.
                        clientOrderId:
                          type: string
                          example: pO9ufTiFGg3nw2fOdgeOXa
                          description: 客户端 订单 ID.
                    description: 订单 列表.
                  orderReports:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: LTCBTC
                          description: 交易对.
                        origClientOrderId:
                          type: string
                          example: pO9ufTiFGg3nw2fOdgeOXa
                          description: orig 客户端 订单 ID.
                        orderId:
                          type: integer
                          example: 2
                          format: int64
                          description: 订单 ID.
                        orderListId:
                          type: integer
                          example: 0
                          format: int64
                          description: 订单 列表 ID.
                        clientOrderId:
                          type: string
                          example: unfWT8ig8i0uj6lPuYLez6
                          description: 客户端 订单 ID.
                        price:
                          type: string
                          example: '1.00000000'
                          description: 价格.
                        origQty:
                          type: string
                          example: '10.00000000'
                          description: orig 数量.
                        executedQty:
                          type: string
                          example: '0.00000000'
                          description: executed 数量.
                        cummulativeQuoteQty:
                          type: string
                          example: '0.00000000'
                          description: cummulative Quote 数量.
                        status:
                          type: string
                          example: CANCELED
                          description: 状态.
                        timeInForce:
                          type: string
                          example: GTC
                          description: 时间 In Force.
                        type:
                          type: string
                          example: STOP_LOSS_LIMIT
                          description: 类型.
                        side:
                          type: string
                          example: SELL
                          description: 方向.
                        stopPrice:
                          type: string
                          example: '1.00000000'
                          description: stop 价格.
                        selfTradePreventionMode:
                          type: string
                          example: NONE
                          description: self 交易 Prevention Mode.
                    description: order Reports.
    get:
      summary: 查询杠杆账户 OCO (USER_DATA)
      description: 根据提供的可选参数检索特定的杠杆账户 OCO 订单。
      tags:
        - trade
      operationId: queryMarginAccountsOco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-oco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsOco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_oco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_oco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsOcoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsOco/QueryMarginAccountsOco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsOcoExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: LTCBTC
            description: 逐仓杠杆必填，全仓杠杆不支持该参数
        - name: orderListId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: '`orderListId` 或 `listClientOrderId` 必须被提供'
        - name: origClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
            description: '`orderListId` 或 `origClientOrderId` 必须提供一个。'
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户's OCO
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderListId:
                    type: integer
                    example: 27
                    format: int64
                    description: 订单 列表 ID.
                  contingencyType:
                    type: string
                    example: OCO
                    description: contingency 类型.
                  listStatusType:
                    type: string
                    example: EXEC_STARTED
                    description: 列表 状态 类型.
                  listOrderStatus:
                    type: string
                    example: EXECUTING
                    description: 列表 订单 状态.
                  listClientOrderId:
                    type: string
                    example: h2USkA5YQpaXHPIrkd96xE
                    description: 列表 客户端 订单 ID.
                  transactionTime:
                    type: integer
                    example: 1565245656253
                    format: int64
                    description: transaction 时间.
                  symbol:
                    type: string
                    example: LTCBTC
                    description: 交易对.
                  isIsolated:
                    type: boolean
                    example: true
                    description: 是否是逐仓symbol交易
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: LTCBTC
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 4
                          format: int64
                          description: 订单 ID.
                        clientOrderId:
                          type: string
                          example: qD1gy3kc3Gx0rihm9Y3xwS
                          description: 客户端 订单 ID.
                    description: 订单 列表.
  /sapi/v1/margin/order:
    delete:
      summary: 杠杆账户撤销订单 (TRADE)
      description: 杠杆账户撤销有效订单。
      tags:
        - trade
      operationId: marginAccountCancelOrder
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-order
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountCancelOrder.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_cancel_order.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_cancel_order.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountCancelOrderExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountCancelOrder/MarginAccountCancelOrder.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountCancelOrderExample.php
      x-ip-weight: 10
      x-security-type: TRADE
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: LTCBTC
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: orderId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: origClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
        - name: newClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
            description: 用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: '- 必须发送 orderId 或 origClientOrderId 其中一个。'
      responses:
        '200':
          description: 杠杆 账户 取消订单
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                    example: LTCBTC
                    description: 交易对.
                  orderId:
                    type: string
                    example: '28'
                    description: 订单 ID.
                  origClientOrderId:
                    type: string
                    example: myOrder1
                    description: orig 客户端 订单 ID.
                  clientOrderId:
                    type: string
                    example: cancelMyOrder1
                    description: 客户端 订单 ID.
                  price:
                    type: string
                    example: '1.00000000'
                    description: 价格.
                  origQty:
                    type: string
                    example: '10.00000000'
                    description: orig 数量.
                  executedQty:
                    type: string
                    example: '8.00000000'
                    description: executed 数量.
                  cummulativeQuoteQty:
                    type: string
                    example: '8.00000000'
                    description: cummulative Quote 数量.
                  status:
                    type: string
                    example: CANCELED
                    description: 状态.
                  timeInForce:
                    type: string
                    example: GTC
                    description: 时间 In Force.
                  type:
                    type: string
                    example: LIMIT
                    description: 类型.
                  side:
                    type: string
                    example: SELL
                    description: 方向.
                  isIsolated:
                    type: boolean
                    example: true
                    description: 是否是逐仓symbol交易
    post:
      summary: 杠杆账户下单 (TRADE)
      description: 杠杆账户下单
      tags:
        - trade
      operationId: marginAccountNewOrder
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-order
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountNewOrder.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_new_order.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_new_order.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountNewOrderExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountNewOrder/MarginAccountNewOrder.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountNewOrderExample.php
      x-security-type: TRADE
      x-signed: true
      x-weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: '- autoRepayAtCancel 补充说明： 在频繁下单撤单的情况下，为提高资金利用率，建议设置为FALSE'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - symbol
                - side
                - type
                - timestamp
              properties:
                symbol:
                  type: string
                  example: BTCUSDT
                isIsolated:
                  type: string
                  example: 'FALSE'
                  default: 'FALSE'
                  enum:
                    - 'TRUE'
                    - 'FALSE'
                side:
                  type: string
                  example: BUY
                  enum:
                    - BUY
                    - SELL
                type:
                  type: string
                  example: LIMIT
                  enum:
                    - LIMIT
                    - MARKET
                    - STOP_LOSS
                    - STOP_LOSS_LIMIT
                    - TAKE_PROFIT
                    - TAKE_PROFIT_LIMIT
                    - LIMIT_MAKER
                quantity:
                  type: number
                  example: '1.0'
                  format: float
                quoteOrderQty:
                  type: number
                  example: '1.0'
                  format: float
                price:
                  type: number
                  example: '1.0'
                  format: float
                stopPrice:
                  type: number
                  example: '1.0'
                  format: float
                  description: 用于 `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` 订单.
                newClientOrderId:
                  type: string
                  example: '1'
                  description: 客户自定义的唯一订单ID。若未发送自动生成。
                icebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: 与 `LIMIT`, `STOP_LOSS_LIMIT`, 和 `TAKE_PROFIT_LIMIT` 一起使用创建 iceberg 订单.
                newOrderRespType:
                  type: string
                  example: ACK
                  enum:
                    - ACK
                    - RESULT
                    - FULL
                  description: MARKET and 限制 订单 types 默认 to FULL, all other 订单 默认 to ACK.
                sideEffectType:
                  type: string
                  example: NO_SIDE_EFFECT
                  default: NO_SIDE_EFFECT
                  enum:
                    - NO_SIDE_EFFECT
                    - MARGIN_BUY
                    - AUTO_REPAY
                    - AUTO_BORROW_REPAY
                timeInForce:
                  type: string
                  example: GTC
                  enum:
                    - GTC
                    - IOC
                    - FOK
                selfTradePreventionMode:
                  type: string
                  example: NONE
                  enum:
                    - EXPIRE_TAKER
                    - EXPIRE_MAKER
                    - EXPIRE_BOTH
                    - NONE
                trailingDelta:
                  type: integer
                  format: int64
                  example: 100
                  description: 配合 `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` 订单使用。
                autoRepayAtCancel:
                  type: boolean
                  example: true
                  description: 只有在自动借款单或者自动借还单生效，true表示的是撤单后需要把订单产生的借款归还，默认为true
                  default: true
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 New 订单
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                    example: BTCUSDT
                    description: 交易对.
                  orderId:
                    type: integer
                    example: 26769564559
                    format: int64
                    description: 订单 ID.
                  clientOrderId:
                    type: string
                    example: E156O3KP4gOif65bjuUK5V
                    description: 客户端 订单 ID.
                  isIsolated:
                    type: boolean
                    example: false
                    description: 是否是逐仓symbol交易
                  transactTime:
                    type: integer
                    example: 1713873075893
                    format: int64
                    description: transact 时间.
                  price:
                    type: string
                    example: '0'
                    description: 价格.
                  origQty:
                    type: string
                    example: '0.001'
                    description: orig 数量.
                  executedQty:
                    type: string
                    example: '0.001'
                    description: executed 数量.
                  cummulativeQuoteQty:
                    type: string
                    example: '65.98253'
                    description: cummulative Quote 数量.
                  status:
                    type: string
                    example: FILLED
                    description: 状态.
                  timeInForce:
                    type: string
                    example: GTC
                    description: 时间 In Force.
                  type:
                    type: string
                    example: MARKET
                    description: 类型.
                  side:
                    type: string
                    example: SELL
                    description: 方向.
                  selfTradePreventionMode:
                    type: string
                    example: EXPIRE_MAKER
                    description: self 交易 Prevention Mode.
                  marginBuyBorrowAmount:
                    type: integer
                    example: 5
                    format: int64
                    description: 杠杆 Buy 借款 数量.
                  marginBuyBorrowAsset:
                    type: string
                    example: BTC
                    description: 杠杆 Buy 借款 资产.
                  fills:
                    type: array
                    items:
                      type: object
                      properties:
                        price:
                          type: string
                          example: '65982.53'
                          description: 价格.
                        qty:
                          type: string
                          example: '0.001'
                          description: 数量.
                        commission:
                          type: string
                          example: '0.06598253'
                          description: 手续费.
                        commissionAsset:
                          type: string
                          example: USDT
                          description: 手续费 资产.
                        tradeId:
                          type: integer
                          example: 3570680726
                          format: int64
                          description: 交易 ID.
                    description: fills 列表.
    get:
      summary: 查询杠杆账户订单 (USER_DATA)
      description: 查询杠杆账户订单
      tags:
        - trade
      operationId: queryMarginAccountsOrder
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-order
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsOrder.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_order.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_order.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsOrderExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsOrder/QueryMarginAccountsOrder.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsOrderExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BNBBTC
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: orderId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: origClientOrderId
          in: query
          required: false
          schema:
            type: string
            example: '1'
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 必须发送 orderId 或 origClientOrderId 其中一个。
        - 一些历史订单的 cummulativeQuoteQty < 0, 是指当前数据不存在。
      responses:
        '200':
          description: 杠杆 账户's 订单
          content:
            application/json:
              schema:
                type: object
                properties:
                  clientOrderId:
                    type: string
                    example: ZwfQzuDIGpceVhKW5DvCmO
                    description: 客户端 订单 ID.
                  cummulativeQuoteQty:
                    type: string
                    example: '0.00000000'
                    description: cummulative Quote 数量.
                  executedQty:
                    type: string
                    example: '0.00000000'
                    description: executed 数量.
                  icebergQty:
                    type: string
                    example: '0.00000000'
                    description: iceberg 数量.
                  isWorking:
                    type: boolean
                    example: true
                    description: 字段说明：is Working.
                  orderId:
                    type: integer
                    example: 213205622
                    format: int64
                    description: 订单 ID.
                  origQty:
                    type: string
                    example: '0.30000000'
                    description: orig 数量.
                  price:
                    type: string
                    example: '0.00493630'
                    description: 价格.
                  side:
                    type: string
                    example: SELL
                    description: 方向.
                  status:
                    type: string
                    example: NEW
                    description: 状态.
                  stopPrice:
                    type: string
                    example: '0.00000000'
                    description: stop 价格.
                  symbol:
                    type: string
                    example: BNBBTC
                    description: 交易对.
                  isIsolated:
                    type: boolean
                    example: true
                    description: is 逐仓.
                  time:
                    type: integer
                    example: 1562133008725
                    format: int64
                    description: 时间.
                  timeInForce:
                    type: string
                    example: GTC
                    description: 时间 In Force.
                  type:
                    type: string
                    example: LIMIT
                    description: 类型.
                  selfTradePreventionMode:
                    type: string
                    example: NONE
                    description: self 交易 Prevention Mode.
                  updateTime:
                    type: integer
                    example: 1562133008725
                    format: int64
                    description: update 时间.
  /sapi/v1/margin/order/oco:
    post:
      summary: 杠杆账户 OCO 下单 (TRADE)
      description: 杠杆账户发送新 OCO 订单。
      tags:
        - trade
      operationId: marginAccountNewOco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountNewOco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_new_oco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_new_oco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountNewOcoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountNewOco/MarginAccountNewOco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountNewOcoExample.php
      x-security-type: TRADE
      x-signed: true
      x-weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: |-
        - autoRepayAtCancel 补充说明： 在频繁下单撤单的情况下，为提高资金利用率，建议设置为FALSE
        - 价格限制:
        - `SELL`: 限价 > 最新成交价 >触发价
        - `BUY`: 限价 < 最新成交价 < 触发价
        - 数量限制:
        - 两个 legs 必须具有同样的数量。
        - `ICEBERG`数量不必相同
        - 下单rate
        - 一个`OCO`订单被算成2个普通订单.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - symbol
                - side
                - quantity
                - price
                - stopPrice
                - timestamp
              properties:
                symbol:
                  type: string
                  example: LTCBTC
                isIsolated:
                  type: string
                  example: 'FALSE'
                  default: 'FALSE'
                  enum:
                    - 'TRUE'
                    - 'FALSE'
                listClientOrderId:
                  type: string
                  example: '1'
                  description: A unique ID for the entire 订单列表
                side:
                  type: string
                  example: BUY
                  enum:
                    - BUY
                    - SELL
                quantity:
                  type: number
                  example: '1.0'
                  format: float
                limitClientOrderId:
                  type: string
                  example: '1'
                  description: A unique ID for the 限制 订单
                price:
                  type: number
                  example: '1.0'
                  format: float
                limitIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                stopClientOrderId:
                  type: string
                  example: '1'
                  description: A unique ID for the stop loss/stop loss 限制 leg
                stopPrice:
                  type: number
                  example: '1.0'
                  format: float
                stopLimitPrice:
                  type: number
                  example: '1.0'
                  format: float
                  description: If provIDed, `stop限制时间InForce` is required.
                stopIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                stopLimitTimeInForce:
                  type: string
                  example: GTC
                  enum:
                    - GTC
                    - FOK
                    - IOC
                newOrderRespType:
                  type: string
                  example: ACK
                  enum:
                    - ACK
                    - RESULT
                    - FULL
                sideEffectType:
                  type: string
                  example: NO_SIDE_EFFECT
                  default: NO_SIDE_EFFECT
                  enum:
                    - NO_SIDE_EFFECT
                    - MARGIN_BUY
                    - AUTO_REPAY
                    - AUTO_BORROW_REPAY
                selfTradePreventionMode:
                  type: string
                  example: NONE
                  enum:
                    - EXPIRE_TAKER
                    - EXPIRE_MAKER
                    - EXPIRE_BOTH
                    - NONE
                autoRepayAtCancel:
                  type: boolean
                  example: false
                  default: true
                  description: Only when MARGIN_BUY or AUTO_BORROW_REPAY 订单 takes effect, true means that the debt generated by the 订单 needs to be 还款 after the 订单 is cancelled.
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 New OCO
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderListId:
                    type: integer
                    example: 0
                    format: int64
                    description: 订单 列表 ID.
                  contingencyType:
                    type: string
                    example: OCO
                    description: contingency 类型.
                  listStatusType:
                    type: string
                    example: EXEC_STARTED
                    description: 列表 状态 类型.
                  listOrderStatus:
                    type: string
                    example: EXECUTING
                    description: 列表 订单 状态.
                  listClientOrderId:
                    type: string
                    example: JYVpp3F0f5CAG15DhtrqLp
                    description: 列表 客户端 订单 ID.
                  transactionTime:
                    type: integer
                    example: 1563417480525
                    format: int64
                    description: transaction 时间.
                  symbol:
                    type: string
                    example: LTCBTC
                    description: 交易对.
                  marginBuyBorrowAmount:
                    type: string
                    example: '5'
                    description: 下单后没有发生借款则不返回该字段
                  marginBuyBorrowAsset:
                    type: string
                    example: BTC
                    description: 下单后没有发生借款则不返回该字段
                  isIsolated:
                    type: boolean
                    example: false
                    description: 是否是逐仓symbol交易
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: LTCBTC
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 2
                          format: int64
                          description: 订单 ID.
                        clientOrderId:
                          type: string
                          example: Kk7sqHb9J6mJWTMDVW7Vos
                          description: 客户端 订单 ID.
                    description: 订单 列表.
                  orderReports:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: LTCBTC
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 2
                          format: int64
                          description: 订单 ID.
                        orderListId:
                          type: integer
                          example: 0
                          format: int64
                          description: 订单 列表 ID.
                        clientOrderId:
                          type: string
                          example: Kk7sqHb9J6mJWTMDVW7Vos
                          description: 客户端 订单 ID.
                        transactTime:
                          type: integer
                          example: 1563417480525
                          format: int64
                          description: transact 时间.
                        price:
                          type: string
                          example: '0.000000'
                          description: 价格.
                        origQty:
                          type: string
                          example: '0.624363'
                          description: orig 数量.
                        executedQty:
                          type: string
                          example: '0.000000'
                          description: executed 数量.
                        cummulativeQuoteQty:
                          type: string
                          example: '0.000000'
                          description: cummulative Quote 数量.
                        status:
                          type: string
                          example: NEW
                          description: 状态.
                        timeInForce:
                          type: string
                          example: GTC
                          description: 时间 In Force.
                        type:
                          type: string
                          example: STOP_LOSS
                          description: 类型.
                        side:
                          type: string
                          example: BUY
                          description: 方向.
                        stopPrice:
                          type: string
                          example: '0.960664'
                          description: stop 价格.
                        selfTradePreventionMode:
                          type: string
                          example: NONE
                          description: self 交易 Prevention Mode.
  /sapi/v1/margin/order/oto:
    post:
      summary: 杠杆账户OTO下单 (TRADE)
      description: |-
        发送一个新的 OTO 订单。

        - 一个 OTO 订单（One-Triggers-the-Other）是一个包含了两个订单的订单列表.

        - 第一个订单被称为**生效订单**，必须为 `LIMIT` 或 `LIMIT_MAKER` 类型的订单。最初，订单簿上只有生效订单。

        - 第二个订单被称为**待处理订单**。它可以是任何订单类型，但不包括使用参数 `quoteOrderQty` 的 `MARKET`
        订单。只有当生效订单**完全成交**时，待处理订单才会被自动下单。

        - 如果生效订单或者待处理订单中的任意一个被单独取消，订单列表中剩余的那个订单也会被随之取消或过期。

        - 如果生效订单在下订单列表后**立即完全成交**，则可能会得到订单响应。其中，生效订单的状态为 `FILLED` ，但待处理订单的状态为
        `PENDING_NEW`。针对这类情况，如果需要检查当前状态，您可以查询相关的待处理订单。

        - `OTO` 订单将**2 个订单**添加到未成交订单计数，`EXCHANGE_MAX_NUM_ORDERS` 过滤器和
        `MAX_NUM_ORDERS` 过滤器中。
      tags:
        - trade
      operationId: marginAccountNewOto
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oto
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountNewOto.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_new_oto.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_new_oto.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountNewOtoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountNewOto/MarginAccountNewOto.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountNewOtoExample.php
      x-security-type: TRADE
      x-signed: true
      x-weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: |-
        - autoRepayAtCancel 补充说明：在频繁下单撤单的情况下，为提高资金利用率，建议设置为 FALSE
        - 根据 pendingType 或 workingType 的不同值，对于某些可选参数有强制要求 | 类型                                                     | 强制要求的参数                                               | 其他信息 | | -------------------------------------------------------- | ------------------------------------------------------------ | -------- | | `workingType` = `LIMIT`                                  | `workingTimeInForce`                                         |          | | `pendingType` = `LIMIT`                                  | `pendingPrice`， `pendingTimeInForce`                        |          | | `pendingType` = `STOP_LOSS` 或 `TAKE_PROFIT`             | `pendingStopPrice` 与/或 `pendingTrailingDelta`              |          | | `pendingType` = `STOP_LOSS_LIMIT` 或 `TAKE_PROFIT_LIMIT` | `pendingPrice`， `pendingStopPrice` 与/或 `pendingTrailingDelta`， `pendingTimeInForce` |          | | 当传入 `pendingTrailingDelta` 时 | `pendingPrice` |          |
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - symbol
                - workingType
                - workingSide
                - workingPrice
                - workingQuantity
                - workingIcebergQty
                - pendingType
                - pendingSide
                - pendingQuantity
                - timestamp
              properties:
                symbol:
                  type: string
                  example: BTCUSDT
                isIsolated:
                  type: string
                  example: 'FALSE'
                  default: 'FALSE'
                  enum:
                    - 'TRUE'
                    - 'FALSE'
                listClientOrderId:
                  type: string
                  example: '1'
                  description: Arbitrary unique ID among open 订单 lists. 若不传则自动生成。<br/>A new 订单 列表 with the same listClientOrderId is accepted only when the previous one is filled or completely expired.<br/>`listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`.
                newOrderRespType:
                  type: string
                  example: ACK
                  enum:
                    - ACK
                    - RESULT
                    - FULL
                  description: MARKET and 限制 订单 types 默认 to FULL, all other 订单 默认 to ACK.
                sideEffectType:
                  type: string
                  example: NO_SIDE_EFFECT
                  enum:
                    - NO_SIDE_EFFECT
                    - MARGIN_BUY
                selfTradePreventionMode:
                  type: string
                  example: NONE
                  enum:
                    - EXPIRE_TAKER
                    - EXPIRE_MAKER
                    - EXPIRE_BOTH
                    - NONE
                autoRepayAtCancel:
                  type: boolean
                  example: true
                  description: 仅在相关订单生效时，true 表示撤单后需归还订单产生的负债。
                  default: true
                workingType:
                  type: string
                  example: LIMIT
                  enum:
                    - LIMIT
                    - LIMIT_MAKER
                workingSide:
                  type: string
                  example: SELL
                  enum:
                    - BUY
                    - SELL
                workingClientOrderId:
                  type: string
                  example: '1'
                  description: Arbitrary unique ID among open 订单 for the working 订单. 若不传则自动生成。
                workingPrice:
                  type: number
                  example: '1.0'
                  format: float
                workingQuantity:
                  type: number
                  example: '1.0'
                  format: float
                  description: Sets the quantity 用于 the working 订单.
                workingIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: This can 仅 be used if `working 时间 In Force` is `GTC`.
                workingTimeInForce:
                  type: string
                  example: GTC
                  enum:
                    - GTC
                    - IOC
                    - FOK
                pendingType:
                  type: string
                  example: LIMIT
                  enum:
                    - LIMIT
                    - MARKET
                    - STOP_LOSS
                    - STOP_LOSS_LIMIT
                    - TAKE_PROFIT
                    - TAKE_PROFIT_LIMIT
                    - LIMIT_MAKER
                pendingSide:
                  type: string
                  example: BUY
                  enum:
                    - BUY
                    - SELL
                pendingClientOrderId:
                  type: string
                  example: '1'
                  description: Arbitrary unique ID among open 订单 for the pending 订单. 若不传则自动生成。
                pendingPrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingStopPrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingTrailingDelta:
                  type: number
                  example: '1.0'
                  format: float
                pendingQuantity:
                  type: number
                  example: '1.0'
                  format: float
                  description: Sets the quantity 用于 the pending 订单.
                pendingIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: This can 仅 be used if `pending 时间 In Force` is `GTC`.
                pendingTimeInForce:
                  type: string
                  example: GTC
                  enum:
                    - GTC
                    - IOC
                    - FOK
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 New OTO
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderListId:
                    type: integer
                    example: 13551
                    format: int64
                    description: 订单 列表 ID.
                  contingencyType:
                    type: string
                    example: OTO
                    description: contingency 类型.
                  listStatusType:
                    type: string
                    example: EXEC_STARTED
                    description: 列表 状态 类型.
                  listOrderStatus:
                    type: string
                    example: EXECUTING
                    description: 列表 订单 状态.
                  listClientOrderId:
                    type: string
                    example: JDuOrsu0Ge8GTyvx8J7VTD
                    description: 列表 客户端 订单 ID.
                  transactionTime:
                    type: integer
                    example: 1725521998054
                    format: int64
                    description: transaction 时间.
                  symbol:
                    type: string
                    example: BTCUSDT
                    description: 交易对.
                  isIsolated:
                    type: boolean
                    example: false
                    description: is 逐仓.
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: BTCUSDT
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 29896699
                          format: int64
                          description: 订单 ID.
                        clientOrderId:
                          type: string
                          example: y8RB6tQEMuHUXybqbtzTxk
                          description: 客户端 订单 ID.
                    description: 订单 列表.
                  orderReports:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: BTCUSDT
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 29896699
                          format: int64
                          description: 订单 ID.
                        orderListId:
                          type: integer
                          example: 13551
                          format: int64
                          description: 订单 列表 ID.
                        clientOrderId:
                          type: string
                          example: y8RB6tQEMuHUXybqbtzTxk
                          description: 客户端 订单 ID.
                        transactTime:
                          type: integer
                          example: 1725521998054
                          format: int64
                          description: transact 时间.
                        price:
                          type: string
                          example: '80000.00000000'
                          description: 价格.
                        origQty:
                          type: string
                          example: '0.02000000'
                          description: orig 数量.
                        executedQty:
                          type: string
                          example: '0'
                          description: executed 数量.
                        cummulativeQuoteQty:
                          type: string
                          example: '0'
                          description: cummulative Quote 数量.
                        status:
                          type: string
                          example: NEW
                          description: 状态.
                        timeInForce:
                          type: string
                          example: GTC
                          description: 时间 In Force.
                        type:
                          type: string
                          example: LIMIT
                          description: 类型.
                        side:
                          type: string
                          example: SELL
                          description: 方向.
                        selfTradePreventionMode:
                          type: string
                          example: NONE
                          description: self 交易 Prevention Mode.
                    description: 订单 Reports 列表.
  /sapi/v1/margin/order/otoco:
    post:
      summary: 杠杆账户OTOCO下单 (TRADE)
      description: |-
        杠杆账户OTOCO下单：


        - 一个 OTOCO 订单（One-Triggers-One-Cancels-the-Other）是一个包含了三个订单的订单列表。

        - 第一个订单被称为 生效订单，必须为LIMIT 或 LIMIT_MAKER类型的订单。最初，订单簿上只有生效订单。
          - 生效订单的行为与此一致 OTO。
        - 一个OTOCO订单有两个待处理订单（pending above 和 pending below），它们构成了一个 OCO
        订单列表。只有当生效订单 完全成交时，待处理订单们才会被自动下单。
          - 待处理上方(pending above)订单和待处理下方(pending below)订单都遵循与 OCO 订单列表相同的规则 [Order List OCO](https://developers.binance.com/zh-CN/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oco)。
        - `OTOCO` 在未成交订单计数，`EXCHANGE_MAX_NUM_ORDERS` 过滤器和 `MAX_NUM_ORDERS`
        过滤器的基础上添加**3个订单**。
      tags:
        - trade
      operationId: marginAccountNewOtoco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-otoco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginAccountNewOtoco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_account_new_otoco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_account_new_otoco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginAccountNewOtocoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginAccountNewOtoco/MarginAccountNewOtoco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginAccountNewOtocoExample.php
      x-security-type: TRADE
      x-signed: true
      x-weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: |-
        - autoRepayAtCancel 补充说明：在频繁下单撤单的情况下，为提高资金利用率，建议设置为 FALSE
        - 根据 pendingAboveType、pendingBelowType 或 workingType 的不同值，对于某些可选参数有强制要求 | 类型                                 | 强制要求的参数                                               | 其他信息 | | ------------------------------------ | ------------------------------------------------------------ | -------- | | `workingType` = `LIMIT`              | `workingTimeInForce`                                         |          | | `pendingAboveType`= `LIMIT_MAKER`    | `pendingAbovePrice`                                          |          | | `pendingAboveType`= `STOP_LOSS`      | `pendingAboveStopPrice` 与/或 `pendingAboveTrailingDelta`    |          | | `pendingAboveType`=`STOP_LOSS_LIMIT` | `pendingAbovePrice`， `pendingAboveStopPrice` 与/或 `pendingAboveTrailingDelta`， `pendingAboveTimeInForce` |          | | `pendingBelowType`= `LIMIT_MAKER`    | `pendingBelowPrice`                                          |          | | `pendingBelowType`= `STOP_LOSS`      | `pendingBelowStopPrice` 与/或 `pendingBelowTrailingDelta`    |          | | `pendingBelowType`=`STOP_LOSS_LIMIT` | `pendingBelowPrice`， `pendingBelowStopPrice` 与/或 `pendingBelowTrailingDelta`， `pendingBelowTimeInForce` |          | | 当传入 `pendingAboveTrailingDelta` 时 | `pendingAbovePrice` |          | | 当传入 `pendingBelowTrailingDelta` 时 | `pendingBelowPrice` |          |
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - symbol
                - workingType
                - workingSide
                - workingPrice
                - workingQuantity
                - pendingSide
                - pendingQuantity
                - pendingAboveType
                - timestamp
              properties:
                symbol:
                  type: string
                  example: BTCUSDT
                isIsolated:
                  type: string
                  example: 'FALSE'
                  default: 'FALSE'
                  enum:
                    - 'TRUE'
                    - 'FALSE'
                sideEffectType:
                  type: string
                  example: NO_SIDE_EFFECT
                  enum:
                    - NO_SIDE_EFFECT
                    - MARGIN_BUY
                autoRepayAtCancel:
                  type: boolean
                  example: true
                  description: 只有在自动借款单生效时，true表示的是撤单后需要把订单产生的借款归还，默认为true
                  default: true
                listClientOrderId:
                  type: string
                  example: '1'
                  description: 整个订单列表的唯一ID。 如果未发送则自动生成。仅当前一个订单列表已填满或完全过期时，才会接受含有相同 `listClientOrderId` 值的新订单列表。`listClientOrderId` 与 `workingClientOrderId`， `pendingAboveClientOrderId` 以及 `pendingBelowClientOrderId` 不同。
                newOrderRespType:
                  type: string
                  example: ACK
                  enum:
                    - ACK
                    - RESULT
                    - FULL
                selfTradePreventionMode:
                  type: string
                  example: NONE
                  enum:
                    - EXPIRE_TAKER
                    - EXPIRE_MAKER
                    - EXPIRE_BOTH
                    - NONE
                workingType:
                  type: string
                  example: LIMIT
                  enum:
                    - LIMIT
                    - LIMIT_MAKER
                workingSide:
                  type: string
                  example: SELL
                  enum:
                    - BUY
                    - SELL
                workingClientOrderId:
                  type: string
                  example: '1'
                  description: 用于标识生效订单的唯一ID。如果未发送则自动生成。
                workingPrice:
                  type: number
                  example: '1.0'
                  format: float
                workingQuantity:
                  type: number
                  example: '1.0'
                  format: float
                workingIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: 只有当 `workingTimeInForce` 为 `GTC` 时才能使用。
                workingTimeInForce:
                  type: string
                  example: FOK
                  enum:
                    - GTC
                    - IOC
                    - FOK
                pendingSide:
                  type: string
                  example: BUY
                  enum:
                    - BUY
                    - SELL
                pendingQuantity:
                  type: number
                  example: '1.0'
                  format: float
                pendingAboveType:
                  type: string
                  example: LIMIT_MAKER
                  enum:
                    - LIMIT_MAKER
                    - STOP_LOSS
                    - STOP_LOSS_LIMIT
                pendingAboveClientOrderId:
                  type: string
                  example: '1'
                  description: 用于标识待处理上方订单的唯一ID。如果未发送则自动生成。
                pendingAbovePrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingAboveStopPrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingAboveTrailingDelta:
                  type: number
                  example: '1.0'
                  format: float
                pendingAboveIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: 只有当 `pendingAboveTimeInForce` 为 `GTC` 时才能使用。
                pendingAboveTimeInForce:
                  type: string
                  example: FOK
                  enum:
                    - GTC
                    - IOC
                    - FOK
                pendingBelowType:
                  type: string
                  example: LIMIT_MAKER
                  enum:
                    - LIMIT_MAKER
                    - STOP_LOSS
                    - STOP_LOSS_LIMIT
                pendingBelowClientOrderId:
                  type: string
                  example: '1'
                  description: 用于标识待处理上方订单的唯一ID。如果未发送则自动生成。
                pendingBelowPrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingBelowStopPrice:
                  type: number
                  example: '1.0'
                  format: float
                pendingBelowTrailingDelta:
                  type: number
                  example: '1.0'
                  format: float
                pendingBelowIcebergQty:
                  type: number
                  example: '1.0'
                  format: float
                  description: 只有当 `pendingBelowTimeInForce` 为 `GTC` 时才能使用。
                pendingBelowTimeInForce:
                  type: string
                  example: FOK
                  enum:
                    - GTC
                    - IOC
                    - FOK
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户 New OTOCO
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderListId:
                    type: integer
                    example: 13509
                    format: int64
                    description: 订单 列表 ID.
                  contingencyType:
                    type: string
                    example: OTO
                    description: contingency 类型.
                  listStatusType:
                    type: string
                    example: EXEC_STARTED
                    description: 列表 状态 类型.
                  listOrderStatus:
                    type: string
                    example: EXECUTING
                    description: 列表 订单 状态.
                  listClientOrderId:
                    type: string
                    example: u2AUo48LLef5qVenRtwJZy
                    description: 列表 客户端 订单 ID.
                  transactionTime:
                    type: integer
                    example: 1725521881300
                    format: int64
                    description: transaction 时间.
                  symbol:
                    type: string
                    example: BNBUSDT
                    description: 交易对.
                  isIsolated:
                    type: boolean
                    example: false
                    description: is 逐仓.
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: BNBUSDT
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 28282534
                          format: int64
                          description: 订单 ID.
                        clientOrderId:
                          type: string
                          example: IfYDxvrZI4kiyqYpRH13iI
                          description: 客户端 订单 ID.
                    description: 订单 列表.
                  orderReports:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: BNBUSDT
                          description: 交易对.
                        orderId:
                          type: integer
                          example: 28282534
                          format: int64
                          description: 订单 ID.
                        orderListId:
                          type: integer
                          example: 13509
                          format: int64
                          description: 订单 列表 ID.
                        clientOrderId:
                          type: string
                          example: IfYDxvrZI4kiyqYpRH13iI
                          description: 客户端 订单 ID.
                        transactTime:
                          type: integer
                          example: 1725521881300
                          format: int64
                          description: transact 时间.
                        price:
                          type: string
                          example: '300.00000000'
                          description: 价格.
                        origQty:
                          type: string
                          example: '1.00000000'
                          description: orig 数量.
                        executedQty:
                          type: string
                          example: '0'
                          description: executed 数量.
                        cummulativeQuoteQty:
                          type: string
                          example: '0'
                          description: cummulative Quote 数量.
                        status:
                          type: string
                          example: NEW
                          description: 状态.
                        timeInForce:
                          type: string
                          example: GTC
                          description: 时间 In Force.
                        type:
                          type: string
                          example: LIMIT
                          description: 类型.
                        side:
                          type: string
                          example: BUY
                          description: 方向.
                        selfTradePreventionMode:
                          type: string
                          example: NONE
                          description: self 交易 Prevention Mode.
                        stopPrice:
                          type: string
                          example: '299.00000000'
                          description: stop 价格.
                    description: 订单 Reports 列表.
  /sapi/v1/margin/manual-liquidation:
    post:
      summary: 杠杆手动强平 (TRADE)
      description: 杠杆手动强平
      tags:
        - trade
      operationId: marginManualLiquidation
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-manual-liquidation
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/marginManualLiquidation.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/margin_manual_liquidation.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/margin_manual_liquidation.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/MarginManualLiquidationExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/MarginManualLiquidation/MarginManualLiquidation.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/MarginManualLiquidationExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 3000
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      x-parameters-notes: |-
        - 该接口支持全仓杠杆经典模式和专业模式。
        - 逐仓杠杆仅在受限地区支持。
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - type
                - timestamp
              properties:
                type:
                  type: string
                  example: MARGIN
                  enum:
                    - MARGIN
                    - ISOLATED
                symbol:
                  type: string
                  example: ETHUSDT
                  description: 当 `type` 选择 `ISOLATED` 时，必须填写 `symbol`
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 Manual Liquidation
          content:
            application/json:
              schema:
                type: object
                properties:
                  asset:
                    type: string
                    example: ETH
                    description: 资产.
                  interest:
                    type: string
                    example: '0.00083334'
                    description: 利息.
                  principal:
                    type: string
                    example: '0.001'
                    description: 本金.
                  liabilityAsset:
                    type: string
                    example: USDT
                    description: liability 资产.
                  liabilityQty:
                    type: number
                    example: 0.3552
                    format: float
                    description: liability 数量.
  /sapi/v1/margin/rateLimit/order:
    get:
      summary: 查询目前杠杆账户下单数 (TRADE)
      description: 获取用户在当前时间区间内的杠杆账户下单总数。
      tags:
        - trade
      operationId: queryCurrentMarginOrderCountUsage
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-current-margin-order-count-usage
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryCurrentMarginOrderCountUsage.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_current_margin_order_count_usage.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_current_margin_order_count_usage.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryCurrentMarginOrderCountUsageExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryCurrentMarginOrderCountUsage/QueryCurrentMarginOrderCountUsage.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryCurrentMarginOrderCountUsageExample.php
      x-ip-weight: 20
      x-security-type: TRADE
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
            description: 逐仓交易对，查询逐仓杠杆账户必需
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 当前 杠杆 订单 Count Usage
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    rateLimitType:
                      type: string
                      example: ORDERS
                      description: 利率 限制 类型.
                    interval:
                      type: string
                      example: SECOND
                      description: 字段说明：interval.
                    intervalNum:
                      type: integer
                      example: 10
                      format: int64
                      description: 字段说明：interval Num.
                    limit:
                      type: integer
                      example: 10000
                      format: int64
                      description: 限制.
                    count:
                      type: integer
                      example: 0
                      format: int64
                      description: 字段说明：count.
  /sapi/v1/margin/allOrderList:
    get:
      summary: 查询特定杠杆账户所有 OCO (USER_DATA)
      description: 根据提供的可选参数检索特定杠杆账户所有的 OCO 订单。
      tags:
        - trade
      operationId: queryMarginAccountsAllOco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-all-oco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsAllOco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_all_oco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_all_oco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsAllOcoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsAllOco/QueryMarginAccountsAllOco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsAllOcoExample.php
      x-ip-weight: 200
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: LTCBTC
            description: 逐仓杠杆必填，全仓杠杆不支持该参数
        - name: fromId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            example: 100
            format: int64
            maximum: 1000
            default: 500
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户's all OCO
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    orderListId:
                      type: integer
                      example: 29
                      format: int64
                      description: 订单 列表 ID.
                    contingencyType:
                      type: string
                      example: OCO
                      description: contingency 类型.
                    listStatusType:
                      type: string
                      example: EXEC_STARTED
                      description: 列表 状态 类型.
                    listOrderStatus:
                      type: string
                      example: EXECUTING
                      description: 列表 订单 状态.
                    listClientOrderId:
                      type: string
                      example: amEEAXryFzFwYF1FeRpUoZ
                      description: 列表 客户端 订单 ID.
                    transactionTime:
                      type: integer
                      example: 1565245913483
                      format: int64
                      description: transaction 时间.
                    symbol:
                      type: string
                      example: LTCBTC
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: true
                      description: 是否是逐仓symbol交易
                    orders:
                      type: array
                      items:
                        type: object
                        properties:
                          symbol:
                            type: string
                            example: LTCBTC
                            description: 交易对.
                          orderId:
                            type: integer
                            example: 4
                            format: int64
                            description: 订单 ID.
                          clientOrderId:
                            type: string
                            example: oD7aesZqjEGlZrbtRpy5zB
                            description: 客户端 订单 ID.
                      description: 订单 列表.
  /sapi/v1/margin/allOrders:
    get:
      summary: 查询杠杆账户的所有订单 (USER_DATA)
      description: 查询杠杆账户的所有订单
      tags:
        - trade
      operationId: queryMarginAccountsAllOrders
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-all-orders
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsAllOrders.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_all_orders.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_all_orders.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsAllOrdersExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsAllOrders/QueryMarginAccountsAllOrders.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsAllOrdersExample.php
      x-ip-weight: 200
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BNBBTC
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: orderId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            example: 100
            format: int64
            default: 500
            maximum: 500
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 如果设置 orderId , 获取订单 >= orderId ， 否则返回24小时内的订单历史。
        - 一些历史订单的 cummulativeQuoteQty < 0, 是指当前数据不存在。
        - startTime和endTime的时间间隔不可超过24小时
      responses:
        '200':
          description: 杠杆 账户's All 订单
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    clientOrderId:
                      type: string
                      example: D2KDy4DIeS56PvkM13f8cP
                      description: 客户端 订单 ID.
                    cummulativeQuoteQty:
                      type: string
                      example: '0.00000000'
                      description: cummulative Quote 数量.
                    executedQty:
                      type: string
                      example: '0.00000000'
                      description: executed 数量.
                    icebergQty:
                      type: string
                      example: '0.00000000'
                      description: iceberg 数量.
                    isWorking:
                      type: boolean
                      example: false
                      description: 字段说明：is Working.
                    orderId:
                      type: integer
                      example: 41295
                      format: int64
                      description: 订单 ID.
                    origQty:
                      type: string
                      example: '5.31000000'
                      description: orig 数量.
                    price:
                      type: string
                      example: '0.22500000'
                      description: 价格.
                    side:
                      type: string
                      example: SELL
                      description: 方向.
                    status:
                      type: string
                      example: CANCELED
                      description: 状态.
                    stopPrice:
                      type: string
                      example: '0.18000000'
                      description: stop 价格.
                    symbol:
                      type: string
                      example: BNBBTC
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: false
                      description: 是否是逐仓symbol交易
                    time:
                      type: integer
                      example: 1565769338806
                      format: int64
                      description: 时间.
                    timeInForce:
                      type: string
                      example: GTC
                      description: 时间 In Force.
                    type:
                      type: string
                      example: TAKE_PROFIT_LIMIT
                      description: 类型.
                    selfTradePreventionMode:
                      type: string
                      example: NONE
                      description: self 交易 Prevention Mode.
                    updateTime:
                      type: integer
                      example: 1565769342148
                      format: int64
                      description: update 时间.
  /sapi/v1/margin/openOrderList:
    get:
      summary: 查询杠杆账户 OCO 挂单 (USER_DATA)
      description: 查询杠杆账户 OCO 挂单
      tags:
        - trade
      operationId: queryMarginAccountsOpenOco
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-oco
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsOpenOco.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_open_oco.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_open_oco.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsOpenOcoExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsOpenOco/QueryMarginAccountsOpenOco.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsOpenOcoExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: LTCBTC
            description: 逐仓杠杆必填，全仓杠杆不支持该参数
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 杠杆 账户's 未完成OCO
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    orderListId:
                      type: integer
                      example: 31
                      format: int64
                      description: 订单 列表 ID.
                    contingencyType:
                      type: string
                      example: OCO
                      description: contingency 类型.
                    listStatusType:
                      type: string
                      example: EXEC_STARTED
                      description: 列表 状态 类型.
                    listOrderStatus:
                      type: string
                      example: EXECUTING
                      description: 列表 订单 状态.
                    listClientOrderId:
                      type: string
                      example: wuB13fmulKj3YjdqWEcsnp
                      description: 列表 客户端 订单 ID.
                    transactionTime:
                      type: integer
                      example: 1565246080644
                      format: int64
                      description: transaction 时间.
                    symbol:
                      type: string
                      example: LTCBTC
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: true
                      description: 是否是逐仓symbol交易
                    orders:
                      type: array
                      items:
                        type: object
                        properties:
                          symbol:
                            type: string
                            example: LTCBTC
                            description: 交易对.
                          orderId:
                            type: integer
                            example: 4
                            format: int64
                            description: 订单 ID.
                          clientOrderId:
                            type: string
                            example: r3EH2N76dHfLoSZWIUw1bT
                            description: 客户端 订单 ID.
                      description: 订单 列表.
  /sapi/v1/margin/myTrades:
    get:
      summary: 查询杠杆账户交易历史 (USER_DATA)
      description: 查询杠杆账户交易历史
      tags:
        - trade
      operationId: queryMarginAccountsTradeList
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-trade-list
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryMarginAccountsTradeList.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_margin_accounts_trade_list.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_margin_accounts_trade_list.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsTradeListExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryMarginAccountsTradeList/QueryMarginAccountsTradeList.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryMarginAccountsTradeListExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BNBBTC
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: orderId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: fromId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
            description: 获取该交易ID之后的数据。默认获取最近的交易。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            example: 500
            format: int64
            default: 500
            maximum: 1000
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 如果设置 fromId , 获取订单 id >= fromId， 否则返回近期24小时内的订单历史。
        - startTime和endTime的时间间隔不可超过24小时
      responses:
        '200':
          description: 杠杆 账户's 交易 列表
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    commission:
                      type: string
                      example: '0.00006000'
                      description: 手续费.
                    commissionAsset:
                      type: string
                      example: BTC
                      description: 手续费 资产.
                    id:
                      type: integer
                      example: 34
                      format: int64
                      description: 字段说明：ID.
                    isBestMatch:
                      type: boolean
                      example: true
                      description: 字段说明：is Best Match.
                    isBuyer:
                      type: boolean
                      example: false
                      description: 字段说明：is Buyer.
                    isMaker:
                      type: boolean
                      example: false
                      description: is 挂单方.
                    orderId:
                      type: integer
                      example: 39324
                      format: int64
                      description: 订单 ID.
                    price:
                      type: string
                      example: '0.02000000'
                      description: 价格.
                    qty:
                      type: string
                      example: '3.00000000'
                      description: 数量.
                    symbol:
                      type: string
                      example: BNBBTC
                      description: 交易对.
                    isIsolated:
                      type: boolean
                      example: false
                      description: 是否是逐仓symbol交易
                    time:
                      type: integer
                      example: 1561973357171
                      format: int64
                      description: 时间.
  /sapi/v1/margin/myPreventedMatches:
    get:
      summary: 查询Prevented Matches (USER_DATA)
      description: Displays the 列表 of 订单 that were expired due to STP. (Self-交易 Prevention).
      tags:
        - trade
      operationId: queryPreventedMatches
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-prevented-matches
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryPreventedMatches.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_prevented_matches.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_prevented_matches.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryPreventedMatches/QueryPreventedMatches.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryPreventedMatchesExample.php
      x-ip-weight: 10
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: BTCUSDT
        - name: preventedMatchId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: orderId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: fromPreventedMatchId
          in: query
          required: false
          schema:
            type: integer
            example: 1
            format: int64
        - name: isIsolated
          in: query
          required: false
          schema:
            type: string
            example: 'FALSE'
            default: 'FALSE'
            enum:
              - 'TRUE'
              - 'FALSE'
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 支持的参数组合: -`symbol` + `preventedMatchId`

        - `symbol` + `orderId`

        - `symbol` + `orderId` + `fromPreventedMatchId`

        - 如果提供`orderId`，将返回与该订单相关的所有被阻止撮合记录。

        - 如果提供 `preventedMatchId`，将返回指定的被阻止撮合记录。

        - 单次请求最多返回500条记录。如果记录超过500条，需要使用 `symbol` + `orderId` +
        `fromPreventedMatchId` 组合进行分页查询。
      responses:
        '200':
          description: 字段说明：Prevented Matches
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                      example: BTCUSDT
                      description: 交易对.
                    preventedMatchId:
                      type: integer
                      example: 1
                      format: int64
                      description: 字段说明：prevented Match ID.
                    takerOrderId:
                      type: integer
                      example: 5
                      format: int64
                      description: taker 订单 ID.
                    makerSymbol:
                      type: string
                      example: BTCUSDT
                      description: maker 交易对.
                    makerOrderId:
                      type: integer
                      example: 3
                      format: int64
                      description: maker 订单 ID.
                    tradeGroupId:
                      type: integer
                      example: 1
                      format: int64
                      description: 交易 Group ID.
                    selfTradePreventionMode:
                      type: string
                      example: EXPIRE_MAKER
                      description: self 交易 Prevention Mode.
                    price:
                      type: string
                      example: '1.100000'
                      description: 价格.
                    makerPreventedQuantity:
                      type: string
                      example: '1.300000'
                      description: maker Prevented 数量.
                    transactTime:
                      type: integer
                      example: 1669101687094
                      format: int64
                      description: transact 时间.
  /sapi/v1/margin/api-key-list:
    get:
      summary: 查询低延迟交易SpecialKey清单 (TRADE)
      description: 查询SpecialKey清单，仅适用低延迟交易SpecialKey。
      tags:
        - trade
      operationId: querySpecialKeyList
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-special-key-list
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/querySpecialKeyList.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_special_key_list.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_special_key_list.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QuerySpecialKeyListExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QuerySpecialKeyList/QuerySpecialKeyList.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QuerySpecialKeyListExample.php
      x-security-type: TRADE
      x-signed: true
      x-uid-weight: 1
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: Special Key 列表
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    apiName:
                      type: string
                      example: testName1
                      description: 字段说明：api Name.
                    apiKey:
                      type: string
                      example: znpOzOAeLVgr2TuxWfNo43AaPWpBbJEoKezh1o8mSQb6ryE2odE11A4AoVlJbQoG
                      description: API密钥.
                    ip:
                      type: string
                      example: 192.168.0.1,192.168.0.2
                      description: 字段说明：ip.
                    type:
                      type: string
                      example: RSA
                      description: 类型.
                    permissionMode:
                      type: string
                      example: TRADE
                      description: permission 模式.
  /sapi/v1/margin/liquidation-loan:
    get:
      summary: 查询强平穿仓欠款 (USER_DATA)
      description: 查询当前用户的全仓杠杆强平穿仓欠款信息，包括原始欠款金额、已还金额和剩余金额。当全仓杠杆账户被强平且账户权益变为负数（穿仓）时，系统会生成一条穿仓欠款记录。该欠款金额以 USDC 计价。
      tags:
        - trade
      operationId: queryLiquidationLoan
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-liquidation-loan
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryLiquidationLoan.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_liquidation_loan.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_liquidation_loan.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryLiquidationLoanExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryLiquidationLoan/QueryLiquidationLoan.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryLiquidationLoanExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 100
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: recvWindow
          in: query
          schema:
            type: integer
            format: int64
            maximum: 60000
            example: 5000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            format: int64
            example: 1770736694138
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 查询强平穿仓欠款
          content:
            application/json:
              schema:
                type: object
                properties:
                  asset:
                    type: string
                    example: USDC
                    description: 穿仓欠款的资产（默认USDC）
                  amount:
                    type: string
                    example: '1000.00000000'
                    description: 穿仓欠款总金额
                  repaidAmount:
                    type: string
                    example: '300.00000000'
                    description: 已还金额
                  remainingAmount:
                    type: string
                    example: '700.00000000'
                    description: 剩余未还金额
  /sapi/v1/margin/liquidation-loan/repay:
    post:
      summary: 偿还强平穿仓欠款 (MARGIN)
      description: 从现货钱包偿还全仓杠杆强平穿仓欠款。穿仓欠款是指在强平过程中账户权益变为负数时产生的亏损。还款金额必须大于0且不能超过剩余欠款余额。若现货账户 USDC 余额不足，还款将失败。
      tags:
        - trade
      operationId: liquidationLoanRepay
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#liquidation-loan-repay
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/liquidationLoanRepay.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/liquidation_loan_repay.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/liquidation_loan_repay.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/LiquidationLoanRepayExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/LiquidationLoanRepay/LiquidationLoanRepay.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/LiquidationLoanRepayExample.php
      x-security-type: MARGIN
      x-signed: true
      x-uid-weight: 100
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - asset
                - amount
                - timestamp
              properties:
                asset:
                  type: string
                  example: USDT
                  description: 还款资产 (如 USDT, USDC)
                amount:
                  type: number
                  format: float
                  example: '300.00'
                  description: 还款金额，必须大于0
                recvWindow:
                  type: integer
                  example: 5000
                  format: int64
                  maximum: 60000
                timestamp:
                  type: integer
                  example: 1770736694138
                  format: int64
                  description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      responses:
        '200':
          description: 偿还强平穿仓欠款
          content:
            application/json:
              schema:
                type: object
                properties:
                  repayId:
                    type: integer
                    example: 12345678
                    format: int64
                    description: 该笔还款交易的唯一标识
                  asset:
                    type: string
                    example: USDT
                    description: 还款使用的资产
                  amount:
                    type: string
                    example: '300.00000000'
                    description: 实际还款金额
                  status:
                    type: string
                    example: SUCCESS
                    enum:
                      - SUCCESS
                      - PENDING
                    description: 还款状态：`SUCCESS`（已完成）或 `PENDING`（处理中）
                  createTime:
                    type: integer
                    example: 1714492800000
                    format: int64
                    description: 还款创建时间（Unix毫秒时间戳）
  /sapi/v1/margin/liquidation-loan/repay-history:
    get:
      summary: 查询强平穿仓欠款还款历史 (USER_DATA)
      description: 查询全仓杠杆强平穿仓欠款的还款历史。支持时间范围过滤和分页。
      tags:
        - trade
      operationId: queryLiquidationLoanRepayHistory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-liquidation-loan-repay-history
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TradeApi/queryLiquidationLoanRepayHistory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/trade_api/query_liquidation_loan_repay_history.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Trade/query_liquidation_loan_repay_history.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryLiquidationLoanRepayHistoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TradeAPI/QueryLiquidationLoanRepayHistory/QueryLiquidationLoanRepayHistory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/trade/QueryLiquidationLoanRepayHistoryExample.php
      x-security-type: USER_DATA
      x-signed: true
      x-uid-weight: 100
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: startTime
          in: query
          schema:
            type: integer
            format: int64
            example: 1714492800000
          description: 起始时间（Unix毫秒时间戳）。未指定时默认为7天前
        - name: endTime
          in: query
          schema:
            type: integer
            format: int64
            example: 1714579200000
          description: 结束时间（Unix毫秒时间戳）。未指定时默认为当前时间
        - name: current
          in: query
          schema:
            type: integer
            format: int64
            example: 1
            default: 1
          description: 当前页码，默认 `1`
        - name: size
          in: query
          schema:
            type: integer
            format: int64
            example: 50
            default: 50
          description: 每页大小，默认 `50`
        - name: recvWindow
          in: query
          schema:
            type: integer
            format: int64
            maximum: 60000
            example: 5000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            format: int64
            example: 1770736694138
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 最大查询范围为90天。如果 `startTime` 早于90天前，将被限制为90天前。
        - 仅返回状态为 `SUCCESS` 或 `PENDING` 的记录，失败的还款记录不会返回。
      responses:
        '200':
          description: 查询强平穿仓欠款还款历史
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    example: 2
                    format: int64
                    description: 还款记录总数
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        repayId:
                          type: integer
                          example: 12345678
                          format: int64
                          description: 还款交易唯一标识
                        asset:
                          type: string
                          example: USDC
                          description: 还款使用的资产
                        amount:
                          type: string
                          example: '300.00000000'
                          description: 还款金额
                        status:
                          type: string
                          example: SUCCESS
                          enum:
                            - SUCCESS
                            - PENDING
                          description: 还款状态：`SUCCESS`（已完成）或 `PENDING`（处理中）
                        createTime:
                          type: integer
                          example: 1714492800000
                          format: int64
                          description: 还款创建时间（Unix毫秒时间戳）
  /sapi/v1/margin/transfer:
    get:
      summary: 获取全仓杠杆划转历史 (USER_DATA)
      description: 获取全仓杠杆划转历史
      tags:
        - transfer
      operationId: getCrossMarginTransferHistory
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/transfer#get-cross-margin-transfer-history
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TransferApi/getCrossMarginTransferHistory.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/transfer_api/get_cross_margin_transfer_history.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Transfer/get_cross_margin_transfer_history.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/transfer/GetCrossMarginTransferHistoryExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TransferAPI/GetCrossMarginTransferHistory/GetCrossMarginTransferHistory.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/transfer/GetCrossMarginTransferHistoryExample.php
      x-ip-weight: 1
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: false
          schema:
            type: string
            example: BNB
        - name: type
          in: query
          required: false
          schema:
            type: string
            example: ROLL_IN
            enum:
              - ROLL_IN
              - ROLL_OUT
        - name: startTime
          in: query
          required: false
          schema:
            type: integer
            example: 1623319461670
            format: int64
        - name: endTime
          in: query
          required: false
          schema:
            type: integer
            example: 1641782889000
            format: int64
        - name: current
          in: query
          required: false
          schema:
            type: integer
            example: 1
            default: 1
            minimum: 1
            format: int64
            description: 当前查询页。
        - name: size
          in: query
          required: false
          schema:
            type: integer
            example: 10
            format: int64
            maximum: 100
            default: 10
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BNBUSDT
            description: 逐仓交易对，适用于逐仓查询
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: |-
        - 响应返回为降序排列。
        - 查询时间范围最大不得超过30天。
        - 若`startTime`和`endTime`没传，则默认返回最近7天数据
      responses:
        '200':
          description: 获取Cross 杠杆 划转 历史
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        amount:
                          type: string
                          example: '0.10000000'
                          description: 数量.
                        asset:
                          type: string
                          example: BNB
                          description: 资产.
                        status:
                          type: string
                          example: CONFIRMED
                          description: 状态.
                        timestamp:
                          type: integer
                          example: 1566898617
                          format: int64
                          description: 时间戳.
                        txId:
                          type: integer
                          example: 5240372201
                          format: int64
                          description: 字段说明：tx ID.
                        type:
                          type: string
                          example: ROLL_IN
                          description: 类型.
                        transFrom:
                          type: string
                          example: SPOT
                          description: SPOT,FUTURES,FIAT,DELIVERY,MINING,逐仓_杠杆,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_杠杆,全仓_杠杆
                        transTo:
                          type: string
                          example: ISOLATED_MARGIN
                          description: SPOT,FUTURES,FIAT,DELIVERY,MINING,逐仓_杠杆,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_杠杆,全仓_杠杆
                        fromSymbol:
                          type: string
                          example: BNBUSDT
                          description: from 交易对.
                        toSymbol:
                          type: string
                          example: BTCUSDT
                          description: to 交易对.
                    description: rows 列表.
                  total:
                    type: integer
                    example: 3
                    format: int64
                    description: 总计.
  /sapi/v1/margin/maxTransferable:
    get:
      summary: 查询最大可转出额 (USER_DATA)
      description: 查询最大可转出额
      tags:
        - transfer
      operationId: queryMaxTransferOutAmount
      externalDocs:
        url: https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/transfer#query-max-transfer-out-amount
      x-connectors-examples:
        ts: https://raw.githubusercontent.com/binance/binance-connector-js/master/clients/margin-trading/examples/rest-api/TransferApi/queryMaxTransferOutAmount.ts
        rust: https://raw.githubusercontent.com/binance/binance-connector-rust/main/examples/margin_trading/rest_api/transfer_api/query_max_transfer_out_amount.rs
        python: https://raw.githubusercontent.com/binance/binance-connector-python/master/clients/margin_trading/examples/rest_api/Transfer/query_max_transfer_out_amount.py
        java: https://raw.githubusercontent.com/binance/binance-connector-java/master/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/transfer/QueryMaxTransferOutAmountExample.java
        go: https://raw.githubusercontent.com/binance/binance-connector-go/main/clients/margintrading/examples/restapi/TransferAPI/QueryMaxTransferOutAmount/QueryMaxTransferOutAmount.go
        php: https://raw.githubusercontent.com/binance/binance-connector-php/master/examples/margin-trading/transfer/QueryMaxTransferOutAmountExample.php
      x-ip-weight: 50
      x-security-type: USER_DATA
      x-signed: true
      parameters:
        - name: X-MBX-APIKEY
          in: header
          required: true
          description: 访问此接口需要 API Key，并且必须在请求头中携带。关于如何创建 API Key，请参考：https://www.binance.com/cn/support/faq/detail/360002502072。
          schema:
            type: string
            example: API_KEY
        - name: asset
          in: query
          required: true
          schema:
            type: string
            example: BTC
        - name: isolatedSymbol
          in: query
          required: false
          schema:
            type: string
            example: BTCUSDT
            description: 逐仓交易对，适用于逐仓查询
        - name: recvWindow
          in: query
          required: false
          schema:
            type: integer
            example: 5000
            format: int64
            maximum: 60000
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            example: 1770736694138
            format: int64
          description: 用于请求签名的 Unix 时间戳，单位为毫秒. 该值必须反映客户端当前时间，并会在签名接口中由服务器进行校验.
      x-parameters-notes: '- If isolated交易对 is not sent, crossed 杠杆 data will be sent.'
      responses:
        '200':
          description: 最大 划转-Out 数量
          content:
            application/json:
              schema:
                type: object
                properties:
                  amount:
                    type: string
                    example: '3.59498107'
                    description: 数量.
