Skip to content

Commit 2cc4551

Browse files
author
gate
committed
update to v7.2.99
1 parent e401de1 commit 2cc4551

195 files changed

Lines changed: 13948 additions & 1030 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 64 additions & 12 deletions
Large diffs are not rendered by default.

‎docs/AssetswapApi.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Name | Type | Description | Notes
221221
222222
Portfolio optimization — place order
223223

224-
将账户内若干源币种按指定数量换入目标币种侧配置,**正式下单前强烈建议先调用** `POST /asset-swap/order/preview` **且 `code=0` 后再用一致的语义提交本接口**。 **请求体不含 `ratio`** - 本接口 `OrderCreateV1Req` 仅含 `from` / `to`,且数组元素均为 `CreateParam`(**仅** `asset` + `amount`)。**请勿**在下单 JSON 中传入 `ratio`;比例字段 `ratio` 只存在于预览接口 `OrderPreviewV1Req.to`(`PreviewToParam`)。 **与预览接口的关键差异(易错点)** - 本接口 `to` 数组元素为 `CreateParam`:**`asset` + `amount`(目标侧数量,十进制字符串)**。 - 预览接口 `to` 为 **`asset` + `ratio`(比例字符串)**,**二者不可混用**:不要把预览里的 `ratio` 原样填到下单的 `amount`,也不要把下单的 `amount` 当成预览的 `ratio`。 **推荐调用顺序** 1. `GET /asset-swap/asset/list`:确认币种支持。 2. `GET /asset-swap/config`:读取 `recommend` / `recommend_v2`(如 `recommend_v2.market` 下某策略的 `schemes`,将 `scheme.name` 作为目标 `asset`、`scheme.ratio` 仅用于 **preview** 的 `to[].ratio`)。 3. `GET /asset-swap/evaluate`(可选):参考可卖数量。 4. `POST /asset-swap/order/preview`:`from` 与 `to`(比例)构造询价。 5. 预览成功后,按产品/服务端约定将预览结果映射为下单的 `from`/`to`(**均为 amount**)再调用本接口。 **字段约定** - `from`:卖出侧,每项为 `asset` + `amount`(字符串,十进制,表示该币种卖出数量)。 - `to`:买入/目标侧,每项为 `asset` + **`amount`**(字符串,十进制,表示该目标币种侧数量;语义与预览的 `ratio` 不同)。 - 本接口仅校验上述 `amount` 的精度与范围;不满足时返回非 0 `code` 及 `message`。预览侧 `to[].ratio` 的校验规则见 `POST /asset-swap/order/preview` 文档。
224+
Swap several source currencies in the account into the target currency side configuration according to the specified amount. **It is strongly recommended to call** `POST /asset-swap/order/preview` **and `code=0` before placing an official order, and then submit this interface with consistent semantics**. **The request body does not contain `ratio`** - This interface `OrderCreateV1Req` only contains `from` / `to`, and the array elements are all `CreateParam` (**only** `asset` + `amount`). **Do not** pass in `ratio` in the order JSON; the ratio field `ratio` only exists in the preview interface `OrderPreviewV1Req.to` (`PreviewToParam`). **Key differences from the preview interface (error-prone points)** - The `to` array element of this interface is `CreateParam`: **`asset` + `amount` (target side quantity, decimal string)**. - The preview interface `to` is **`asset` + `ratio` (ratio string)**, **the two cannot be mixed**: do not fill in the `ratio` in the preview to the `amount` of the order as it is, and do not use the `amount` of the order as the `ratio` of the preview. **Recommended calling order** 1. `GET /asset-swap/asset/list`: Confirm currency support. 2. `GET /asset-swap/config`: Read `recommend` / `recommend_v2` (such as `schemes` of a strategy under `recommend_v2.market`, use `scheme.name` as the target `asset`, `scheme.ratio` is only used for `to[].ratio` of **preview**). 3. `GET /asset-swap/evaluate` (optional): Refer to the sellable quantity. 4. `POST /asset-swap/order/preview`: `from` and `to` (ratio) construct inquiry. 5. After the preview is successful, map the preview results to the `from`/`to` (**both are amount**) of the order according to the product/server agreement and then call this interface. **Field Convention** - `from`: selling side, each item is `asset` + `amount` (string, decimal, indicating the selling amount of the currency). - `to`: Buy/target side, each item is `asset` + **`amount`** (string, decimal, indicating the amount of the target currency side; the semantics are different from the previewed `ratio`). - This interface only verifies the accuracy and range of the above `amount`; if not satisfied, it returns non-0 `code` and `message`. For the verification rules of `to[].ratio` on the preview side, see the `POST /asset-swap/order/preview` document.
225225

226226
### Example
227227

@@ -371,7 +371,7 @@ Name | Type | Description | Notes
371371
372372
Portfolio optimization — preview
373373

374-
根据卖出币种数量与**目标分配比例**估算成交与费用,**不写入订单**。`code=0` 时 `data` 含预估 `order` 与 `transaction_fee`。 **与下单接口的关键差异(易错点)** - 本接口 `to` 数组元素为 `PreviewToParam`:**`asset` + `ratio`(比例,十进制字符串)**,表示目标币种在组合中的权重/占比。 - 下单接口 `POST /asset-swap/order/create` 的 `to` 为 **`asset` + `amount`(绝对数量)**,**不是** `ratio`。调用方切勿把两套字段混用。 **如何构造 `to`(ratio)** - 优先从 `GET /asset-swap/config` 的 `data.recommend_v2` 取值:按分组键(如 `market`、`faith`、`conservative`)找到策略列表中的某条 `RecommendV2Strategy`(如 `name` 为 `top2`),将其 `schemes` 映射为预览请求: - `to[].asset` ← `scheme.name`(目标币种符号) - `to[].ratio` ← `scheme.ratio`(与配置一致的比例字符串) - 亦可使用 `recommend` 下扁平 map(币种 → 比例字符串)自行展开为多元素 `to`(每项一个 `asset` + `ratio`)。 - 多目标时各 `ratio` 建议与前端/运营配置一致;是否需加总为 1 以服务端校验为准。 **`from`(卖出侧)** - 每项为 `asset` + `amount`(字符串,十进制),表示本次参与换出的该币种数量。币种应在 `GET /asset-swap/asset/list` 支持范围内;数量级过小或市场深度不足时可能返回非 0 `code`(如无法询价)。 **与下单的衔接** - 预览成功后,将业务允许的预览结果转换为下单所需的 **`from`/`to` 全为 amount** 的请求体再调用 create(具体映射规则以产品文档或服务端约定为准)。
374+
The transaction and fees are estimated based on the quantity of coins sold and the **target allocation ratio**, and **no orders are written**. When `code=0`, `data` contains estimated `order` and `transaction_fee`. **Key differences from the order interface (error-prone points)** - The `to` array element of this interface is `PreviewToParam`: **`asset` + `ratio` (ratio, decimal string)**, which represents the weight/proportion of the target currency in the portfolio. - The `to` of the order interface `POST /asset-swap/order/create` is **`asset` + `amount` (absolute quantity)**, **not** `ratio`. Callers should never mix the two sets of fields. **How to construct `to`(ratio)** - Prioritize the value from `data.recommend_v2` of `GET /asset-swap/config`: find a certain `RecommendV2Strategy` in the strategy list (such as `name` is `top2`) by grouping key (such as `market`, `faith`, `conservative`), and map its `schemes` to a preview request: - `to[].asset` ← `scheme.name` (target currency symbol) - `to[].ratio` ← `scheme.ratio` (ratio string consistent with configuration) - You can also use the flat map (currency → ratio string) under `recommend` to expand it into a multi-element `to` (one `asset` + `ratio` for each item). - When there are multiple targets, it is recommended that each `ratio` be consistent with the front-end/operation configuration; whether it needs to be summed to 1 is subject to server-side verification. **`from` (sell side)** - Each item is `asset` + `amount` (string, decimal), indicating the amount of the currency participating in the exchange this time. The currency should be within the supported range of `GET /asset-swap/asset/list`; when the magnitude is too small or the market depth is insufficient, a non-0 `code` may be returned (if the price cannot be inquired). **Connection with order placement** - After the preview is successful, convert the preview results allowed by the business into the request body where **`from`/`to` is all amount** required for ordering and then call create (the specific mapping rules are subject to the product documentation or server agreement).
375375

376376
### Example
377377

‎docs/AwardListStructList.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**reward_coin** | **str** | Reward currency |
1010
**interest** | **str** | Interest amount |
1111
**fee** | **str** | fee |
12-
**status** | **int** | Status |
12+
**status** | **int** | Status. 4 - success |
1313
**bonus_date** | **str** | Date |
1414
**should_bonus_stamp** | **int** | Scheduled distribution timestamp |
1515

‎docs/BatchAmendItem.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Name | Type | Description | Notes
1111
**price** | **str** | Trading Price. Only one of `amount` or `price` can be specified | [optional]
1212
**amend_text** | **str** | Custom info during order amendment | [optional]
1313
**action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
14+
**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional]
15+
**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional]
1416

1517
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1618

‎docs/BatchAmendOrderReq.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**size** | **str** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional]
1010
**price** | **str** | New order price | [optional]
1111
**amend_text** | **str** | Custom info during order amendment | [optional]
12+
**action_mode** | **str** | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional]
1213

1314
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1415

‎docs/BatchOrder.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ Name | Type | Description | Notes
4040
**rebated_fee_currency** | **str** | Rebated fee currency unit | [optional] [readonly]
4141
**stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
4242
**stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. If the user did not use 'stp_act' when placing the order, 'stp_act' will return '-' - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, new ones - cb: Cancel both, Both old and new orders will be cancelled | [optional]
43-
**finish_as** | **str** | 订单结束方式,包括: - open: 等待处理 - filled: 完全成交 - cancelled: 用户撤销 - liquidate_cancelled: 爆仓撤销 - small: 订单数量太小 - depth_not_enough: 深度不足导致撤单 - trader_not_enough: 对手方不足导致撤单 - ioc: 未立即成交,因为 tif 设置为 ioc - poc: 未满足挂单策略,因为 tif 设置为 poc/rvt/rat/rpi表示只想成为maker, 经检查会成为taker被拒绝 - fok: 未立即完全成交,因为 tif 设置为 fok - stp: 订单发生自成交限制而被撤销 - price_protect_cancelled: 价格保护导致撤单 - unknown: 未知 | [optional] [readonly]
43+
**finish_as** | **str** | How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown | [optional] [readonly]
4444
**slippage** | **str** | Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) | [optional]
45+
**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional]
46+
**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional]
4547

4648
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
4749

‎docs/BotApi.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Method | HTTP request | Description
2121
2222
Get AIHub strategy recommendations
2323

24-
discover 域唯一正式接口。 支持场景: - `top1` - `bundle` - `filter` - `refresh` 约束: - 主动推荐池仅包含 `spot_grid`、`futures_grid`、`spot_martingale` - 可返回但不主动推荐 `infinite_grid`、`margin_grid` - 不得返回 `contract_martingale`、`smart-position`、`spot-future-arbitrage` - `scene=filter` 时只允许按 `market`、`backtest_apr_gte`、`max_drawdown_lte` 过滤 - `scene=refresh` 通过 `refresh_recommendation_id` 承接刷新上下文;正式最小格式只要求 `strategy_type|market` - 若上游直接透传上一条推荐的 `recommendation_id`,其中第三段 `backtest_id` 当前会被忽略
24+
The only formal interface for the discover domain. Support scenarios: - `top1` - `bundle` - `filter` - `refresh` Constraints: - The active recommendation pool only contains `spot_grid`, `futures_grid`, `spot_martingale` - Can return but do not actively recommend `infinite_grid`, `margin_grid` - `contract_martingale`, `smart-position`, `spot-future-arbitrage` must not be returned - When `scene=filter` is used, only filtering by `market`, `backtest_apr_gte`, `max_drawdown_lte` is allowed - `scene=refresh` inherits the refresh context through `refresh_recommendation_id`; the official minimum format only requires `strategy_type|market` - If the upstream directly transmits the previous recommendation `recommendation_id`, the third paragraph `backtest_id` will currently be ignored.
2525

2626
### Example
2727

@@ -422,7 +422,7 @@ Name | Type | Description | Notes
422422
423423
Create Spot Martin
424424

425-
根据传入参数创建现货马丁策略。 止损口径与 App / `MartingaleBot` 一致: - 使用 **`create_params.stop_loss_per_cycle`**(每轮止损比例,小数字符串),**不要**使用 `stop_loss_price` 表达创建侧止损。 - 详情页展示的「止损价」由引擎按轮次计算;创建侧可选 **`create_params.trigger_price`**(触发价)。
425+
Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / `MartingaleBot`: - Use **`create_params.stop_loss_per_cycle`** (ratio per round as a decimal string) for creation-side stop-loss; **do not** use `stop_loss_price` for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional **`create_params.trigger_price`** (trigger price).
426426

427427
### Example
428428

‎docs/ChaseOrder.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ChaseOrder
2+
3+
Chase order detail or list item
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **str** | | [optional]
8+
**user** | **str** | | [optional]
9+
**contract** | **str** | | [optional]
10+
**settle** | **str** | | [optional]
11+
**amount** | **str** | Total size in contracts; positive for buy, negative for sell | [optional]
12+
**price_limit** | **str** | | [optional]
13+
**reduce_only** | **bool** | | [optional]
14+
**text** | **str** | | [optional]
15+
**create_time** | **int** | | [optional]
16+
**finish_time** | **int** | | [optional]
17+
**original_status** | **int** | Raw status enum | [optional]
18+
**status** | **str** | Simplified status, e.g. open / finished | [optional]
19+
**reason** | **str** | | [optional]
20+
**fill_amount** | **str** | | [optional]
21+
**average_fill_price** | **str** | | [optional]
22+
**suborder_id** | **str** | | [optional]
23+
**is_dual_mode** | **bool** | | [optional]
24+
**side_label** | **str** | | [optional]
25+
**position_side_output** | **str** | | [optional]
26+
**chase_price** | **str** | | [optional]
27+
**interval_sec** | **int** | | [optional]
28+
**updated_at** | **int** | | [optional]
29+
**suborder_price** | **str** | | [optional]
30+
**suborder_ongoing** | **bool** | | [optional]
31+
**suborder_finish_as** | **str** | | [optional]
32+
**price_type** | **int** | PriceType enum: 1 latest, 2 index, 3 mark | [optional]
33+
**price_gap_type** | **str** | | [optional]
34+
**price_gap_value** | **str** | | [optional]
35+
**status_code** | **str** | | [optional]
36+
**create_time_precise** | **str** | Creation time (seconds.microseconds) | [optional]
37+
**finish_time_precise** | **str** | | [optional]
38+
**pos_margin_mode** | **str** | | [optional]
39+
**position_mode** | **str** | | [optional]
40+
**leverage** | **str** | | [optional]
41+
**error_label** | **str** | | [optional]
42+
43+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
44+
45+

‎docs/Contract.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Name | Type | Description | Notes
5151
**funding_rate_limit** | **str** | Upper and lower limits of funding rate | [optional]
5252
**contract_type** | **str** | Contract classification type, e.g. stocks, metals, indices, forex, commodities, etc. | [optional]
5353
**funding_impact_value** | **str** | Funding rate depth impact value | [optional]
54+
**enable_circuit_breaker** | **bool** | Whether the newly launched contract activates mark price circuit breaker (If the platform intends to activate this mechanism for a newly launched contract market to prevent significant price fluctuations and excessive liquidations after launch, an advance announcement will be made). | [optional]
5455

5556
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
5657

0 commit comments

Comments
 (0)